0

I have a div wrapper around my comments pagination. I have the comments set to paginate in the Wordpress admin at 10 comments per page. I want to hide the div wrapper if there are less than 10 comments (i.e. the pagination links aren't shown). I can't figure out how to do this. I know how to hide the div wrapper if pagination is turned off altogether, but I don't know how to check to see if the comments don't span to a second page when pagination is turned on. Here is my code:

<div class="comment-nav-wrapper"> <div class="left-cap">&nbsp;</div> <div class="comment-nav"> <?php paginate_comments_links($args); ?> </div> <div class="right-cap">&nbsp;</div> </div> 

I would like to hide the comment-nav-wrapper altogether if the comments don't span to a second page. Is there some sort of Wordpress function for this, or do I need to come up with a bit of custom code?

1 Answer 1

0

Use the comments number function or the more native get_comments_number function and combine it with the page comments option if ( get_option( page_comments ) == TRUE ) // do stuff

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.