[resolved] can't get the next post link to work. (4 posts)

  1. patrickowtf
    Posted 3 years ago #

    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.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    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.

  3. patrickowtf
    Posted 3 years ago #


    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.]

  4. patrickowtf
    Posted 3 years ago #

    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.]

Topic Closed

This topic has been closed to new replies.

About this Topic