Added Next & Previous links to single.php

Viewing 6 posts - 1 through 6 (of 6 total)
  • #3510
    jimophoto
    Participant

    I saw a couple threads in here asking about creating links to the next & previous posts within single.php, but no answers. I worked up something that works for me and looks good, so figured I’d share.

    The code starts after the ‘div id=container’ line & ends before the ‘arcticle id=post’ line

    <div style="text-align:center;margin-left:-300px;">
    <?php previous_post('&laquo; &laquo;&nbsp;&nbsp;%', '', 'yes'); ?>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<?php next_post('%&nbsp;&nbsp;&raquo; &raquo;', '', 'yes'); ?>
    </div>
    <br />

    • This topic was modified 12 years, 10 months ago by jimophoto.
    • This topic was modified 12 years, 10 months ago by jimophoto.
    • This topic was modified 12 years, 10 months ago by jimophoto.
    • This topic was modified 12 years, 10 months ago by jimophoto.
    #3516
    jimophoto
    Participant

    just copy/paste the entire thing into single.php…lines 2-3 of the code in this post is actually just one really long line. It’ll paste correctly.

    #3519
    jimophoto
    Participant
    #11541
    GreenGriot
    Participant

    Thanks for sharing. This definitely helped me out.
    Cheers!

    #11685
    catana
    Participant

    Man, it works great for me too.

    I have a question it’s possible to set the font size? what should I do, any hint will be appreciated.

    #17593
    Akiko
    Participant

    Hi many thanks for this, helped me a lot!
    For the font size, I managed to increase it by adding this:

    <font size=4>
    </font>

    before and after.

    I also altered the text alignment, so mine looks like this:

    <div style=”text-align:left”><font size=4>
    <?php previous_post(‘« «  %’, ”, ‘yes’); ?>   |   <?php next_post(‘%  » »’, ”, ‘yes’); ?></font>

    Hope this helps!

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.