Published in WordPress
avatar
2 minutes read

Finding current page number in Wordpress

I have added the accompanying custom circle in my Wordpress format:

$args = array(
    'category__not_in' => array($featured_cat->term_id),
    'posts_per_page' => 10,
    'post__not_in' => array($recent_post)
);
query_posts($args);

For pagination to work, I surmise I want to pass one more arg paged with the ongoing page number. What is the method for getting the ongoing page number in Wordpress?

Solutions

Not close to a wordpress framework to test this out at the mo, yet you ought to have the option to utilize:

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

(clearly defaulting to 1, in the event that it has not been sent through).

Comments