WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Display Next & Previous posts within single.php (2 posts)

  1. flint_and_tinder
    Member
    Posted 2 years ago #

    Hi All,

    I wonder if anyone can help here?

    What I want to do is create links to the previous and next posts on the single.php pages. However, I do not want them to be just text. Ideally I would like each item to contain the following:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Is there anyway I can do this using either the get_adjacent_posts or get_previous_post/get_next_post snippets? If so, can anyone explain how?

    I've been trawling Google all day for a solution to this to no avail.

    Many thanks,

    Adam.

  2. vtxyzzy
    Member
    Posted 2 years ago #

    Since I can't see your code, I can't be exactly sure what you want.

    You can use an image in previous/next_post_link by putting the html for the image in the second parameter, like this:

    <div class="nav-previous"><?php previous_post_link( '%link', '<img src="http://mysite.com/wp-content/uploads/2010/06/myimage.jpg"',true ); ?></div>

    If you want a link to all previous posts, please give a little detail or put the code in a pastebin and post a link to it here.

Topic Closed

This topic has been closed to new replies.

About this Topic