• So I’ve got some problems with the next_posts_link and previous_posts_link actually going to the right entry on a web site – https://www.helengoesto.com/wp/

    The photos are entries in their own category, and I have used this line of code in the index.php file to block out other categories from displaying there:

    <?php c2c_get_random_posts($num_posts = 1,
    $format = "%post_content%",
    $categories = '2 3 4 6',
    $order = 'DESC',
    $date_format = '',
    $authors = '',
    $include_passworded_posts = false); ?>

    Then, where the written entry is (which is a different category), I have the usual tags for displaying content within the Loop. I am using the default tags for PREVIOUS and NEXT:

    <?php next_posts_link('&laquo; Previous Entries') ?>
    <?php previous_posts_link('Next Entries &raquo;') ?>

    … but it doesn’t work. Every time I click the “Previous Entry” link, the next page displayed is the same written content.

    Again, the temporary site is https://www.helengoesto.com/wp/ — if you want to try testing out what I’ve attempted to describe here. I’m going to continue trying to work it out, but am in need of someone’s help right now …

    Thnx!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter stew278

    (@stew278)

    I’ve found the culprit in my code, but have no idea how to clean it up to make the page work …

    <?php if (is_home()) { query_posts("cat=-5"); } ?> is what I’m using to have the page ignore category 5 (which is the parent directory for all photo categories that are listed above the photo – ie. “Grand Canyon”), where the entry (written word) would go. The photos are randomly generated.

    What do I need to do to make this work?

    bump

    i’m having this problem too.

    anyone have any ideas?

    If you’re having the same problem, then the same solution should correct the problem, shouldn’t it? If it doesn’t correct it, then it obviously is not the same problem. If it’s not the same problem, then you might want to post the details of your problem.

    Good luck,
    Michael.

    Thread Starter stew278

    (@stew278)

    I don’t think it’s clearly answered here, in fact, it really isn’t, now is it?

    Here groundchuck … answer to your problems.

    BUMP.
    I have the same problem: the ‘paged=’ parameter does not work.
    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.


    query_posts("cat=-6");
    if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <div id="post-<?php the_ID(); ?>" class="post">
    <h2 class="post-title">" title="Permalink to <?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></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; ?>
    prenav
    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('« Earlier Posts') ?></div>
    <div class="alignright"><?php previous_posts_link('Later Posts »') ?></div>
    </div>
    postnav
    <?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 . . .

    • the page your looking for was moved;
    • your referring site gave you an incorrect address; or
    • something went terribly wrong.

    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,
    Davide

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PREVIOUS and NEXT post links not working correctly in 2.0’ is closed to new replies.