• 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 15 replies - 1 through 15 (of 25 total)
  • I know it’s confusing and it took me a while to figure things out, but this is the instructions for the previoux_post()

    Used on single post/permalink pages, this tag lists the previous post in chronological order from the current post…

    So next and previous work on single post pages not Looped index.php type pages (search, category, things that have more than one post showing.)

    For multiple post pages like search, archives, category and so on, posts_nav_link() is the one to use.

    You can use both if you want, or just let it stay like it is. Lovely site.

    Thread Starter tyh

    (@tyh)

    So how do I put a link on the main page to go to the previous single post? Do I use the permalink for previous post?

    Thanks for your comment on site! Am really enjoying posting to new site using WP, having previously used MT.

    I believe that if you have the Admin > Options > Read set to show only one post on the front page, the nav link would take you to the next post chronologically, in the past.

    Even through there is only one post on the front page, WordPress “thinks” there could be more than one, so that needs a different next/previous kinda tag. That’s what I get from going through the template tag information. That’s why there are two types.

    Thread Starter tyh

    (@tyh)

    Yes, but then the link would show ayutheos.uni.cc/vf/page/2. Would like to get the link to link directly to the previous individual post.

    Would there be a way to get permalink for the post before eg. <?php the_permalink( current post - 1 ); ?> ?

    I have the same problem!
    just after upgrading to 1.5.1

    In the archives the links work good but not in home

    Thread Starter tyh

    (@tyh)

    Hmm..that doesn’t seem to help, but thanks for the link though Lorelle.

    To clarify things a bit, instead of previous link showing “mysite.com/page/2” I want it to show “mysite.com/permalink/to/previous/post”

    Your theme is totally awesome! I’ve been looking for something like that for a comic I’m drawing and want to put on the web. Have any interest in sharing it?

    Thread Starter tyh

    (@tyh)

    Thanks Axo1ot1. It’s actually a very basic stripped-down theme, modified from the classic theme. Took out out sidebar, using custom posts per page plugin to show 1 post, thumbnail archives using excerpts, a modified upload code available at blueblurry.com. And that’s it. ??

    Am still very much a beginner at using WP, though this forum is a great place to get help from more experienced users.

    Anyone else have a solution to my problem? Is it possible to show permalink to previous post in the index page?

    Someone!

    I have the same problem after upgrade to 1.5.1, reverted back to 1.5 for the time being. It would be nice to have a solution for this without resorting to hacking PHP. I tried using the get_posts function, but it seems like a bit much for just displaying the previous post on the index page.

    Someone has tried 1.5.1.1 ?

    Getting back to the issue at hand, I believe that you just need to set your permalinks and update your htaccess file from the Options > Permalinks page. Then it should work fine.

    And a lot of people have tried 1.5.1 but the issue is with permalinks needing updating.

    <?php previous_post('&laquo; &laquo; %', 'Previous', 'no'); ?>
    <?php if ( is_single() ) { ?>| <?php next_post('% &raquo; &raquo', '', 'yes'); ?>
    <?php } ?>

    Not sure if this is what you’re looking for.. it works for me by going to the previous post with the perm link. but I’m still only testing on 1.5 , Will attempt to upgrade my test site to 1.51. and see if this still works. It checks to see if this is a single post and grabs the next.. also NEXT doesn’t show up on the index page.

    Okay I just looked at your site and I doubt what I posted is what you’re looking for .. sorry. Although I do like the layout very nice! one small suggestion, you can use a link on the secondary pages back to home base. I realized I was in the middle of your site and wanted to go to the beginning.

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