Support » Fixing WordPress » How to addd conditional pagination links on comments?

  • Resolved retroriff

    (@retroriff)


    Hello,

    I am using paginate_comments_links() in order to paginate my comments on WP 2.9. However I’d like to display some code only when the entry has more than 1 comments page. For example:

    <ul>
    	<li>More comments:</li>
    	<li><?php paginate_comments_links(); ?></li>
    </ul>

    Any idea?
    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • <?php if(get_comments_number() > 10/* comments per page */) : ?>
    <ul>
      <li>More comments:</li>
      <li><?php paginate_comments_links(); ?></li>
    </ul>
    <?php endif; ?>

    Better code:

    <?php if(get_comments_number() > get_option('comments_per_page')) : ?>
    <ul>
      <li>More comments:</li>
      <li><?php paginate_comments_links(); ?></li>
    </ul>
    <?php endif; ?>

    Thanks kz, it works perfectly 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to addd conditional pagination links on comments?’ is closed to new replies.