Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I can't get pagination inside categories listings to work.

I'm using a custom query, with the get_query_var('paged'):

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array(
'post__not_in'=>$essentielle_excluded_posts,
'category_name' => 'concours-fun',
'paged'=>$paged, 
'posts_per_page'=>5,
);
query_posts($args);

Also tried the Category Pagination Fix plugin.

My permalink structure: /%category%/%postname%-%post_id%.html

Example of the error: http://www.essentielle.be/concours-fun/page/2

Any idea as to what else i should check?

share|improve this question

1 Answer

up vote 3 down vote accepted

get_query_var('paged') should be get_query_var('page'), however, you should use a pre_get_posts action hook to alter the query rather than using query_posts in the template, which is a waste of resources (see this answer for more info).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.