WordPress.org

Ready to get started?Download WordPress

Forums

Older/Newer Posts links on homepage (2 posts)

  1. rjpooch
    Member
    Posted 2 years ago #

    I have read several posts here and in the CODEX about this issue, but am still having trouble getting the "older posts" and "newer posts" to appear at the bottom of my page.

    I hate to be a bother, but would really like to add them.

    I'm also not sure if I should be putting the code in the home.php file or the index.php file as I have seen posts resolving the issue both ways.

    I'm using the Deskspace 1.5 theme.

    These links do show up on pages that display all posts in a category.

    the code there is:

    <div class="navigation">
            <div class="alignleft">
              <?php next_posts_link('« Older Entries') ?>
            </div>
            <div class="alignright">
              <?php previous_posts_link('Newer Entries »') ?>
            </div>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

    I just don't know where to put this code to have the same thing on the home page.

    my site: http:www.rjpooch.com

    an example of the links working: here

    Thank you for taking a look.

  2. stvwlf
    Member
    Posted 2 years ago #

    It looks like the code should go in home.php if you have a home.php file in your theme.

    home.php is specific for the home (posts) page

    index.php is a more generic template file. if there is no home.php file in a theme WordPress will use index.php

    As to where to put the code, find the code for your category page, which is likely to be category.php or archive.php if no category.php file is in the theme.

    Try to find the equivalent place in home.php that the bottom link code is on in the category template, and insert the code in that position.

    Make a copy of home.php before you do this so if you mess it up you can swap the old file for the changed one and get back to where you are now.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.