WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] can't get the next post link to work.

[Resolved] can't get the next post link to work.

  • Hello everyone. I’m very new at the wordpress game, and i’m getting very frustrated.

    I can’t get links to the next and previous posts to show up. I tried posts_nav_link(), as well as next_post_link() and nothing is working. Nothing is showing up when I look at the source.

    Is there something critical that is needed elsewhere in my code for these functions to work? I’m working with a custom template and maybe I missed something. I have no idea why these aren’t working.

    Anyone have any ideas? I’m willing to post portions of my code and figure it out, but I don’t even know where to begin.

    You can view my (incomplete) site at http://www.thefittedshirtchicago.com/wordpress

    I’m trying to link between the posts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    @esmi

    Forum Moderator

    Since this is a custom template, it might help if you dropped a copy of the template file into the WordPress pastebin and posted the pastebin url here. Perhaps someone will be able to spot the problem and suggest a solution.

    single.php
    http://pastebin.com/kh8Kq3Dx

    this is a post and this is where i’d like to link to the next post.

    [No bumping. If it’s that urgent, consider hiring someone.]

    I ended up figuring it out. I’m not sure why, but this is the code I’m using, and it works.

    <?php previous_post_link( '%link', '<span class="meta-nav">«</span> %title' ) ?> <span style="color: #bbb;">•</span> <?php next_post_link( '%link', '%title <span class="meta-nav">»</span>' ) ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] can't get the next post link to work.’ is closed to new replies.
Skip to toolbar