• Hi,

    When I go to my site (ayutheos.uni.cc/vf/) the links to go to previous/next posts are not showing. However they are shown in individual posts (eg. https://ayutheos.uni.cc/vf/archives/2005-05-10/for-grandma). Am not using home.php or single.php templates. Have tried using home.php with exact codes as index.php but no go. Is there some difference between index.php and individual posts in terms of templates?

    FYI, have just upgraded to WP 1.5.1. Problem wasn’t there prior to upgrading. Am thinking if there’s something to do with the upgrade…

    Am using
    <?php previous_post('%', 'prev . ', 'no'); ?><?php next_post('%', 'next . ', 'no'); ?>
    to go to previous single post. Don’t want to use posts_nav_link as that goes to 2nd page of site.

    Any help is appreciated.

Viewing 10 replies - 16 through 25 (of 25 total)
  • charbyte: I use similar code which does in fact work in 1.5 (highinfrequency.com) but not in 1.5.1. After re-reading the documentation for previous_post(), this appears to be the expected behavior. But I don’t see an obvious way to put the permalink to the previous post on the index page ?? I tried get_permalink(the_ID – 1), but that failed. Even if it had worked, that is not the ideal way to get the link, it is possible that the the_ID() – 1 could point to a page that has not been published yet.

    Thread Starter tyh

    (@tyh)

    Yes, previous_post/next_post worked when I was using 1.5, but not when upgraded to 1.5.1.

    At index.php I’ve used both <?php posts_nav_link(”,”,’previous .’); ?> (showing the word ‘previous’) and <?php previous_post(‘%’, ‘prev . ‘, ‘no’); ?> (showing the word ‘prev’), and only one of them comes up – post_nav_link when at main site, previous_post when at single post.

    There is a link back to the homepage – clicking on the site title at the top will bring you back to the beginning. ?? Guess didn’t make the link back home more obvious.

    Lorelle, my permalinks are working fine. Have updated them, as suggested but that doesn’t solve the problem.

    Just tried 1.5.1 and it does not work there either. Bummer.

    I did a quick workaround which I’m using in my index.php template. The explaination and code are on my blog.

    Yup, blueblurry’s fix works like a charm.

    Yes I tested it out and it works fantubulous thanks BlueBlurry. Going to use this live … one of these days :d

    Can anyone post the Blueblurry fix? The site seems down and I can’t find the code anywhere.

    i second mperron’s request – albeit a month later…

    i’m in dire need of a prev/next fix for the vesuvius theme… running on wp 2.0.1 ??

    In wp 2.0.x, I was having a similar issue also. To get the raw url for the previous post, I used something like the following (in index.php):

    <?php global $wp_query; $wp_query->is_single = true; ?>

    <a href="<?php echo get_permalink(get_previous_post()); ?>">PREVIOUS POST</a>

    <?php endwhile; ?>

    I think what this does is ‘trick’ the index page into thinking that its a single post.

    There are too many damn variations of previous* and next* in the wp codebase. The docs need some serious cleaning up.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Previous & Next links to show on index.php’ is closed to new replies.