ThemeForest

Wordpress paging note

204 posts Bold WordPress Theme Development
  • Has been a member for 3-4 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Interviewed on the Envato Notes blog
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Bought between 1 and 9 items
  • Europe
  • Referred between 200 and 499 users
srhnbr says

Has anyone else noticed the following note on http://codex.wordpress.org/Function_Reference/WP_Query#Interacting_with_WP_Query

Pagination Note: You should set get_query_var( ‘page’ ); if you want your query to work with pagination. Since Wordpress 3.0.2, you do get_query_var( ‘page’ ) instead of get_query_var( ‘paged’ ).

Well, I just tried it and it does not work but the old way [ get_query_var( ‘paged’ ) ] still does.

Anyone else observed this too?

1 year ago
3086 posts
  • Has been a member for 3-4 years
  • Author had a File in an Envato Bundle
  • Interviewed on the Envato Notes blog
  • Author had a Free File of the Month
  • Beta Tester
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Italy
  • Referred between 100 and 199 users
ParkerAndKent says

Hi,

you should use get_query_var( ‘page’ ) only if you set for the front page a static page that has a pagination in it.

Don’t ask me why they complicated a simple thing like this…

1 year ago
798 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 10 and 49 items
  • United States
fillerspace says

Maybe an if statement would work:

if(get_query_var('paged')) {
     $paged = get_query_var('paged');
} elseif(get_query_var('page')) {
     $paged = get_query_var('page');
} else {
     $paged = 1;
}
1 year ago
204 posts Bold WordPress Theme Development
  • Has been a member for 3-4 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Interviewed on the Envato Notes blog
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Bought between 1 and 9 items
  • Europe
  • Referred between 200 and 499 users
srhnbr says

Hi,

you should use get_query_var( ‘page’ ) only if you set for the front page a static page that has a pagination in it.

Don’t ask me why they complicated a simple thing like this…

Yes, exactly that’s what I thought. I knew I was not going mad!

Thanks again :)

1 year ago
by
by
by
by
by