Forums

How to put title of previous and next posts on main page (index.php)? (5 posts)

  1. timoni
    Member
    Posted 4 years ago #

    I'd like the php next_post/php previous_post tags on the main page to show the name of the previous post title, not just a rather less-than-descriptive "previous" or "next". Is this at all possible? I don't know PHP, but I'm assuming that if it can be done on single.php pages, then it can be done on the main index.php page, too.

  2. David Yeiser
    Member
    Posted 4 years ago #

    Do you have an example site to link? Have you looked at next_post_link() and previous_post_link()?

  3. daniiswara
    Member
    Posted 4 years ago #

    how do I put title="..." on next_posts_link?

  4. hmo00odi007
    Member
    Posted 4 years ago #

    what is ths page????

  5. Roy
    Member
    Posted 4 years ago #

    <div class="navigation">
    <div class="alignleft"><?php previous_post_link('&laquo; %link') ?></div><br />
    <div class="alignright"><?php next_post_link('%link &raquo;') ?></div>
    </div>

    This is what I use in my single.php, but I don't know if it also works if the next page has more than one post.

Topic Closed

This topic has been closed to new replies.

About this Topic