salromano
Member
Posted 9 months ago #
I have paginated comments activated on my blog. I also have it styled within a div. Problem is, if there isn't enough comments to separate them into more than one page, I have an empty div.
Is there some sort of 'if has paginated comments' function or workaround I can use that will only display the div if the post has enough comments to paginate?
Here's my code:
<div id="paginate_comments"><?php paginate_comments_links(); ?></div>
this is the related conditional code from twenty eleven's comments.php:
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
salromano
Member
Posted 9 months ago #
Thank you so much. Worked like a charm! Final code for anyone that needs:
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?><div id="paginate_comments"><?php paginate_comments_links(); ?></div><?php endif; ?>