0
我想改變只顯示在我的存檔頁面上的帖子, 請讓我知道如何做到這一點,謝謝。如何在歸檔頁面上顯示自定義的帖子數量?
這是從我的archive.php
<div id="content-a">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<div class="imgdiv"><a href="<?php the_permalink() ?>"><img src="<?php echo catch_that_image() ?>" width="250"></a></div>
<div class="p-heading"><h1><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1></div>
<div class="p-content"><?php the_excerpt(); ?></div>
<div class="p-info"><?php the_time('j.m.Y') ?> | <?php the_category(', '); ?> | <img src="http://www.virmodrosti.com/wp-content/uploads/comments.png" alt="Komentarji" width="26" height="12"><?php $totalcomments = get_comments_number(); echo $totalcomments; ?></div>
</div>
<?php endwhile; ?>
的代碼,我想有不同數量的存檔頁面職位。謝謝。
謝謝。如果您也想將此規則應用於搜索結果,那麼您是否在is_archive之後添加了is_search? – Techuser
檢查我已更新答案,但您應該在最後一次更改前嘗試。 –
謝謝,它工作正常。 – Techuser