WordPress.org

Ready to get started?Download WordPress

Forums

Add Navigation Arrows To WordPress Blog (3 posts)

  1. prateekmallapur
    Member
    Posted 5 years ago #

    Hi guys,

    I have a blog and I want to add navigation arrows at the end of the blog.

    For eg., after the end of the page, there should be two arrows viz. <- and ->

    When the user clicks to the left, he goes to the next page and when right, he goes to the previous.

    I searched but couldn't find it anywhere.

    Please help, it's urgent!!

    Regards,

    Prateek

    Website URL : http://www.noelife.com/blog1

  2. msdana
    Member
    Posted 5 years ago #

    There should be page navigation after your home page fills up with posts and there are more pages to view. Right now, you only have two posts, so there's no "next" or "previous" pages to go.

  3. Matty Cohen
    Member
    Posted 5 years ago #

    Hi prateekmallapur,

    To add page navigation to your blog, add the following code after the <?php endwhile; ?> in the WordPress loop on your index.php page and any other pages that list more than 1 post:

    <div id="postnav_container">
    <div id="prev_entries" class="alignleft"><?php next_posts_link('Previous Entries') ?></div><!--/#prev_entries-->
    <div id="next_entries" class="alignright"><?php previous_posts_link('Next Entries') ?></div><!--/#next_entries-->
    <div class="clearfix"></div><!--/.clearfix-->
    </div><!--/#postnav_container-->

    The above code snippet adds a "Previous" link and a "Next" link, where necessary, and aligns them to the left and right respectively. The "clearfix" DIV has a CSS style of clear: both; which clears the floating DIVs above it.

    I hope this helps. :)

Topic Closed

This topic has been closed to new replies.

About this Topic