0
我創建了一個模板category-beers.php,它應該顯示來自單個類別的所有帖子。所有帖子都應顯示在表格中。一切正常,但這個代碼只顯示3個最近的帖子。我應該編輯什麼來顯示此類別的所有帖子?爲什麼此代碼只顯示3個條目? WP
<table class="drinked-beers">
<tr>
<th>Beer</th>
<th>Consumer</th>
<th>I drinked this beer on </th>
<th>Style</th>
<th>Note</th>
</tr>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<tr>
<td><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></td>
<td><?php the_author(); ?></td>
<td><?php the_date(''); ?> </td>
<td><?php the_tags(''); ?> </td>
<td><?php echo get_post_meta($post->ID, 'my-note', true); ?></td>
</tr>
<?php endwhile; endif; ?>
</table>
您的帖子數設置爲3嗎?進入'Settings-> Reading'來檢查 –
是的。但我需要在我的主頁上顯示3個帖子。我可以在上面的代碼中設置以顯示所有帖子嗎? –
這是唯一的代碼頁面?有沒有更多? – Stewartside