WordPress.org

Support

Support » How-To and Troubleshooting » showposts error using custom permalink

showposts error using custom permalink

  • The scenario:
    I am using the date name-based permalinks option.
    I have the admin options set up to show 10 posts at the most per page.

    But for category-4, I only want to show 3 posts per page and use pagination for the remainder posts:
    // this code lives outside the loop
    <?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>

    When using the following query:

    <?php query_posts($query_string . "&cat=4&showposts=3"); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    // etc
    I see the initial category with 3 posts, however once I click “Next Page”, I am directed to my theme’s error 404 page.
    And sometimes it’s not until about the 2nd or 3rd page until I get the error page.

    NOW…
    If I change the admin number to show 1 post at most instead of 10, and change the query_posts to show 3 posts or more, everything works fine.

    I’m somewhat a newbie, but I believe there’s some kind of conflicting connection between the admin option and the ‘showposts’ tag.

    Would someone please test this scenario out to see if you get the same results.

    Please Help!

    BTW – I only get this error using custom permalinks, not the default. And yes, my .htaccess file is (777) writable and has been modified by WordPress. The custom permalinks all work fine except when using the ‘showposts’ tag.

  • The topic ‘showposts error using custom permalink’ is closed to new replies.