嗨,我已经编辑并制作了一个响应式主题的模板页面,以制作一些帖子功能图片的缩略图。没关系,我可以看到它们,但即使帖子是 9,我也只能看到 5 个。如果我添加一个,我会看到新的,有类似“仅显示最新 5 个帖子”之类的东西,但我不明白 WHERE !
get_header(); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part( 'loop-header' ); ?>
<?php responsive_entry_before(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php responsive_entry_top(); ?>
<?php get_template_part( 'post-meta-page' ); ?>
<div class="post-entry">
<?php the_content(__('Read more ›', 'responsive')); ?>
<?php wp_link_pages(array('before' => '<div class="pagination">' . __('Pages:', 'responsive'), 'after' => '</div>')); ?>
</div><!-- end of .post-entry -->
(this is my added code)
<ul>
<?php
$posts = get_posts();
foreach($posts as $post) : setup_postdata($post);
?>
<li><div class="fotoBoxContent"><a class="fotoBox" href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); the_title(); ?></a></div></li>
<?php endforeach; ?>
</ul>
<?php responsive_entry_bottom(); ?>
</div><!-- end of #post-<?php the_ID(); ?> -->
<?php responsive_entry_after(); ?>
<?php responsive_comments_before(); ?>
<?php comments_template( '', true ); ?>
<?php responsive_comments_after(); ?>
<?php
endwhile;
get_template_part( 'loop-nav' );
else :
get_template_part( 'loop-no-posts' );
endif;
?>