Support » Themes and Templates » ‘paged=’ parameter not working

  • Resolved nutsmuggler


    The ‘paged=’ parameter does not work, neither in the previous/nex links, nor whe directly typed in the url field of the browser.
    This is my code; this snippet is embedded into a ‘version’ of home.php that displays only if (empty($_REQUEST[‘isarticles’])). In other words, I load this home to exclude posts from category 6.

    if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div id="post-<?php the_ID(); ?>" class="post">
    <h2 class="post-title"><a>" title="Permalink to <?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    <div class="post-entry">
    <?php the_excerpt('<span class="more-link">Continue Reading �</span>'); ?>
    <?php //link_pages('<p class="paged-link">Pages: ', '', 'number'); ?>
    </div><!-- END POST-ENTRY -->
    <!-- <?php trackback_rdf(); ?> -->
    </div><!-- END POST -->
    <?php endwhile; ?>
    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('� Earlier Posts') ?></div>
    <div class="alignright"><?php previous_posts_link('Later Posts �') ?></div>
    <?php else : ?>
    <div id="post-error" class="post">
    <h2 class="post-title"><span class="pre-title">404</span> Page Not Found</h2>
    <div class="post-entry">
    There's been a problem finding the page you're looking for. Apologies. Perhaps . . .
    <li>the page your looking for was moved;</li>
    <li>your referring site gave you an incorrect address; or</li>
    <li>something went terribly wrong.</li>
    Use the search box and see if you can't find what you're looking for.
    </div><!-- END POST-ENTRY -->
    </div><!-- END POST -->
    <?php endif; ?>

    Is there anything in my code that prevents the ‘paged’ parameters from working? Or is it a wp bug?
    Thanks in advance,

Viewing 4 replies - 1 through 4 (of 4 total)
  • I wouldn’t call it a bug… however I have never seen the next/prev to work with a modified Loop.
    I mean just adding a “query_posts” diasables the prev/next – at least that was my impression seeing n+1 posts like yours.

    Ah ah, I see the point.
    Is there a workaround or should use my own parameters? What would you suggest?

    I found the answer here:
    Kafkaesquy suggest modifying the query



    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;

    I understand the problem was that the ‘paged’ value had to explicitly requested.
    BINGO 🙂

    Perfect! Exactly what I was looking for, thanks Kafkaesqui & Nutsmuggler, BINGO 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘‘paged=’ parameter not working’ is closed to new replies.