WordPress.org

Support

Support » How-To and Troubleshooting » navigation links redirects to 404 page on page 2

navigation links redirects to 404 page on page 2

  • nida amin

    @nida-amin

    I have created custom post types in index.php

    <div class="achievements">
             <div class="achievement-header"><h3>Achievements</h3></div>
                <?php query_posts('showposts=3&post_type=achievements&paged='.$paged); ?>
                <?php while (have_posts() ) : the_post(); ?>
                 <div class="achievement-images">
                <?php echo the_post_thumbnail(array(218,265));?>
                </div>
                  <?php endwhile; ?>
                  <?php include(TEMPLATEPATH. '/inc/nav.php');?>
               </div>

    When I click on older entries, it gets redirected to error 404 page i.e It displays 404 page on page 2. Please help me…

Viewing 1 replies (of 1 total)
  • vtxyzzy

    @vtxyzzy

    The code you posted does not show a value set for $paged. If it is not set in earlier lines, try changing this line:

    <?php query_posts('showposts=3&post_type=achievements&paged='.$paged); ?>

    to this:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('showposts=3&post_type=achievements&paged='.$paged); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘navigation links redirects to 404 page on page 2’ is closed to new replies.
Skip to toolbar