Support » How-To and Troubleshooting » [Resolved] Exact Next- Previous Page Code for Blog Posts Page

[Resolved] Exact Next- Previous Page Code for Blog Posts Page

  • Hi,

    Is it possible for someone to provide the exact code I’d need to add to show a “Next Page” link on my blog posts page at http://righthandplanning.com/marketing-news/?
    Or would you need access to the theme files?

    I’ve read about adding the Next Page code here, http://codex.wordpress.org/Next_and_Previous_Links but 1. I didn’t understand it and 2. I’m not sure if refers to an individual blog post or the page of my site that hosts the blog (in my case not the home page, but the page above /marketing-news).

    There are over two years’ worth of posts in my site, but only a handful are currently showing on my blog page, I’d like to offer access to the rest of them at the bottom with a “Next Page” link, and then on the subsequent page there would be Next and Previous links.

    So not sure if I should hire someone or if there’s a simple code that can be added.


Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello Peter.
    In order to add these you would need access to your theme files.
    1. This can be done in the WordPress Dashboard (through “Appearance” ->”Editor”
    2. This can be done through FTP by navigating to your theme directory (your theme is found in wp-content -> themes -> {insert-theme-name-here}

    Next you want to find the file that contains the loop for the set of posts you are trying to give the links to.

    My best guess falls to the index.php for your case, I am not entirely sure though, because I (obviously) am not the one who built your site.

    Viewing the source of your page, the end of your loop would look something like this:

    <a id="blogo-hbtn" href="{reference to permalink here}"></a>
    <div class="clear"></div>

    Followed by an <?php endwhile;?>, then a <?php endif;?>.
    The way I have gotten my next/prev links to work is to add

    <div class="navigation"><p><?php posts_nav_link(); ?></p></div>

    on the next line below that endif at the end of the aforementioned loop.

    This is all based on speculation, because I do not know exactly how your site is set up. I can do it if I am looking right at the code, and even explain it 10x better.

    While this is a simple piece of code, keep in mind that I highly recommend that you use FTP to do it, or when accessing it in the wordpress editor, copy it all over to a notepad document FIRST and save it as “file-name-here-backup.php” while making changes.

    If you would like more in depth help, lemme know. I am free for a good portion of the night (no need to “hire,” I would do it for free), and this seems like it would be a simple code edit.

    Thank you! I think that’s enough information to justify hiring my WordPress person.
    But I greatly appreciate your generous offer to walk me through it.

    No Problem. Good luck!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Exact Next- Previous Page Code for Blog Posts Page’ is closed to new replies.