WordPress.org

Support

Support » How-To and Troubleshooting » How to get excerpts only on paged pages with my custom loop?

How to get excerpts only on paged pages with my custom loop?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi
    Forum Moderator

    @esmi

    Try:

    if ($displayed > 3 || is_paged() )

    That worked to change my paged blog posts to show only excerpts.

    Unfortunately, it had a side effect of displaying tags and comments on my first three post excerpts on page 2. Previously only my full posts would show tags and categories.

    What can I add to this statement to remove the tags and categories from paged pages?

    if ($displayed <= 3)

    Thank you!

    esmi
    Forum Moderator

    @esmi

    Try changing:

    <?php
    if ($displayed <= 3) { ?>
    <div class="post-bottom">
    <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Categories: <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <br>  <?php comments_popup_link('Post a Comment', '1 Comment »', '% Comments »'); ?></p>
    </div>
    <?php } ?>

    to:

    <?php
    if ($displayed <= 3 && !is_paged() ) { ?>
    <div class="post-bottom">
    <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Categories: <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <br>  <?php comments_popup_link('Post a Comment', '1 Comment »', '% Comments »'); ?></p>
    </div>
    <?php } ?>

    thinkluke
    Member

    @thinkluke

    I have been trying to solve this problem for days but i can’t seem to find a solution… has anyone figured it out?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to get excerpts only on paged pages with my custom loop?’ is closed to new replies.