特色图片未显示在博客页面的侧边栏中

时间:2011-10-13 21:30:12

标签: php wordpress

我正在处理我正在处理的网站上的网页问题。我将精选图像设置到所有页面上的侧边栏的一部分(即。关于我们,我们做什么等)但是图像没有显示在包含博客帖子的页面上。以下是博客模板页面中的代码:

<?php
/**
* Template Name: Blog page
* 
* @package WordPress
* @subpackage SPS
*/
?>

<?php get_header(); ?>

    <div id="firstSection">
    <?php query_posts('post_type=post'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    <h1 class="blog-title"><a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a></h1>
    <div class="meta"><?php _e('Posted'); ?>&nbsp;<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
    <?php the_date('','',''); ?></a>&nbsp;<?php _e('by'); ?>&nbsp;<?php the_author(); ?>.&nbsp;
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    <span class="edit-link"><?php edit_post_link(__('[Edit]')); ?></span>
</div>
<div>
    <p class="blog-text"><?php the_excerpt(__('(more...)')); ?></p>
</div>
    <?php endwhile; ?>
    <?php else: ?>
<p>Sorry, no posts matched your criteria.</p>
        <?php endif; ?>
    <?php posts_nav_link(); ?>
    </div>

<?php get_sidebar(); ?>     
<?php get_footer(); ?>

我是否忽略了代码中的某些内容,或者我是否采用了错误的方式?任何帮助将不胜感激。

此致 Dalogi

1 个答案:

答案 0 :(得分:0)

您没有在您发布的代码中的任何位置调用缩略图功能。我通常用the_post_thumbnail()来做。你读过关于这样做的代码吗? http://codex.wordpress.org/Function_Reference/the_post_thumbnail

相关问题