Info
- 6 posts
- 4 voices
- Started 3 years ago by John James Jacoby
- Latest reply from Derek Herman
- This topic is resolved
Check for topic pages > 1
-
- Posted 3 years ago #
Any easy way to check if a topic has multiple pages? I'd like to wrap the pages in a div or UL but only if pages actually exist.
-
- Posted 3 years ago #
Since this plugin does pagination, there are functions in it to figure out how many pages there are then add page links. I suspect if you looked at the functions you might be able to see how it was done by _ck_.
-
- Posted 3 years ago #
That plugin uses the built in bbPress get_page_number_links API, which does not have a function to check for the availability of pages. It only echo's the links if they are needed.
-
- Posted 3 years ago #
To figure out pages is easy.
You lookup how many posts are in the topic and then you divide by the page_topics setting which also happens to be the posts per page setting.something like:
$pages=ceil($topic->topic_posts/bb_get_option('page_topics')); -
- Posted 3 years ago #
Perfect!
...in theme/topics.php...
<?php If (ceil($topic->topic_posts/bb_get_option('page_topics'))>1) { ?> <div class="topic-page"> <?php topic_pages();?> </div> <?php } ?> -
- Posted 3 years ago #
Is there a version for the forums page?
-
You must log in to post.