(Wordpress) Global variable to detect pagination?

Posted by Gnee on Stack Overflow See other posts from Stack Overflow or by Gnee
Published on 2010-04-24T16:32:37Z Indexed on 2010/04/24 16:33 UTC
Read the original article Hit count: 231

Filed under:

I am showing 6 posts on one page. On the 7th post, pagination occurs on so on.

goal: If there is more than one page (page 1, 2, 3, etc..), JavaScript is to add a specific div element. If there are only 6 posts or less, no pagination occurs, no div element is added.

The number of posts to show:

$showposts = get_query_var('showposts');

The current post number I can keep track of:

    $post_count++;

Problem is I can keep track of posts 1-6 but how to tell if if it goes over to 7 and starts pagination? I thought there was a global variable that returns if pagination occurs, but I can't seem to find it.

(I know there is global to detect pagination via <!--nextpage--> but so far I can't find it's equivalent for index.php).

© Stack Overflow or respective owner

Related posts about Wordpress