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

After I have updated my website to wordpress 3.4 the navigation pages work until page 10, and on categories the pages are not working even after page 2-3.... I don't understand why ? here you can see paper-backgrounds.com

I found a solution somewhere here, but it solved the problem only for the blog posts pages index (tags, categories and search still not working)

After I have added this code to theme functions

function my_post_queries( $query ) {
  // not an admin page and it is the main query
  if (!is_admin() && $query->is_main_query()){
    if(is_home()){
      $query->set('posts_per_page', 1);
    }
  }
}
add_action( 'pre_get_posts', 'my_post_queries' );

the pagination of the home/blog posts works correctly, but search, category and tags pagination is still does not work after a certain number of pages, what can I do ?

I think in one of these two files is the problem.

Here is blogstyle.php http://pastebin.com/k2tY1PVn
and defaultindex.php http://pastebin.com/Lkz2Xgf5
share|improve this question
Go into your admin and confirm that the posts are still there, just to check. – Pippin Jun 15 '12 at 20:36
I'm having navigation issues with my front page only. My custom post type pages work just fine. I know that doesn't help you but I thought I would let you know, you are not alone. – kel Jun 15 '12 at 20:37
yes the posts are there. – Mario M Jun 15 '12 at 20:39
did you find a solution ? – Mario M Jun 15 '12 at 20:53

closed as too localized by toscho Sep 17 '12 at 12:24

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

2 Answers

It could be any number of things -- so the best advice is ...

  1. Check if your theme needs to be updated after changing to WP3.4
    • change to the default WordPress Twenty Eleven theme and check if the problem goes away)
  2. a plugin like WP-Navi is out of date
    • disable all plugins and see if the problem goes away
  3. Your Permalinks changed / .htaccess file is not right
    • go to Settings > Permalinks and choose & save an option

To test ... try checking these 2 URL's http://paper-backgrounds.com/page/10/

and this URL http://paper-backgrounds.com/page/11/

hope that helps?

Damien

share|improve this answer
I did that, but it still does not work :( – Mario M Jun 15 '12 at 23:33
I also tried to completely change the theme and after page 10 it still does not work – Mario M Jun 16 '12 at 0:01
It think that this problem comes from WP-PageNavi plugin, but I still don't have a solution... – Mario M Jun 16 '12 at 0:31
@MarioM did you turn off the wp-pagenavi plugin? I see that the page 11 and page 12 is now working. – Damien Jun 16 '12 at 11:52
Hi, I have turned off all the plugins and the problem was still there, so I have activated back wp-navi and added [code] this code to theme functions.php function my_post_queries( $query ) { // not an admin page and it is the main query if (!is_admin() && $query->is_main_query()){ if(is_home()){ $query->set('posts_per_page', 1); } } } <br> but in categories the paging still does not work, and there even after page 2 I get the error...:( add_action( 'pre_get_posts', 'my_post_queries' ); – Mario M Jun 16 '12 at 12:01
show 7 more comments

Of course it doesn't work in Category template, pre_get_posts action is conditioned, it reads "if( is_home() )". You should extend clause to is_category() and/or is_search().

share|improve this answer

protected by Community Jul 4 '12 at 8:56

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

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