• Resolved colindunn

    (@colindunn)


    Like many other people have reported, I cannot seem to get the “next page” button to work. When browsing a category, if I click on the next page link at the bottom of the page I get a 404 error.

    I am using a custom permalink structure (%category%/%postname) and have it setup to only display 4 posts on my index page. However unlike others, setting the ‘Blog pages show at most’ option in my control panel to 4 does not solve the issue.

    Has anyone else solved this problem?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Sounds like your theme’s index.php template file uses a custom query that needs editing.

    I had this problem, try changing the permalink structure:
    Here is my post

    Thread Starter colindunn

    (@colindunn)

    @japaternoster — That worked! But the perfectionist in me wishes that I didn’t have to include those digits at the end. For now, I am glad to have it working, thanks!

    @esmi — I am using this code to get posts and display them on my homepage. Do you have any ideas? (I would still like to find a solution that would allow me to keep my URLs pretty)

    <?php
     $lastposts = get_posts('numberposts=4&category_name=Home');
     foreach($lastposts as $post) :
        setup_postdata($post);
     ?>

    You might be better off using query_posts:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'Home',
            'posts_per_page' => 4,
    	'paged' => $paged
    );
    query_posts($args);
    ?>

    and then just using a standard Loop to output the posts.

    Thread Starter colindunn

    (@colindunn)

    My site didn’t like that code. I think you are right, but so far I haven’t been able to get it to work. This is likely due to my limited knowledge of PHP. Does this code need to be outside the loop?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Next Page 404 Error’ is closed to new replies.