• Resolved cmfcom

    (@cmfcom)


    I have been getting a 404 error on the 4th page of my blog: https://colinmorganfan.com/

    It’s really weird because posts on pages 1-3 show up perfectly fine, but when I get to page 4, I get a 404 error when there should be 3 more posts showing (I have a total of 12 posts, and because page 4 is broken, only 9 posts show up).

    It’s only from page 4 where things seem to go wonky. Even after setting my theme to view 2 posts per page, it’s at page 4 where I get the 404 error.

    Is anyone else having similar problems with WP 3.4? Has anyone figured out a way to fix this problem? Thanks for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter cmfcom

    (@cmfcom)

    I found a solution to this issue. The solution comes from a previous topic.

    You need to add this to the theme’s functions.php file:

    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’ );

    It worked for me, and now my page 4 is showing up fine. Good luck!

    May you live to be 1000 years old sir ??

    I had the same problem, that fixed it!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘404 error on 4th page of blog after 3.4 upgrade’ is closed to new replies.