Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #4521

    HI there,

    I would love the browsers of my website to be able to navigate forwards and back between portfolio posts from within a portfolio post.

    For example, if you take a look at one of my portfolio posts here: http://www.benrobins.com/intel-the-chase/

    I would love to have a link at the top right above the line labeled ‘Next’ which would take the user to the next project along, (http://www.benrobins.com/dirt-3-game-trailer/)

    Is this achievable?

    Many Thanks,

    Ben

    #46657

    Hey,

    replace – in single.php replace:

    the_content('Read more');

    with:

    the_content('Read more');
    previous_post_link('%link', 'Next project', TRUE); ?>
    <?php next_post_link('%link', 'Next project', TRUE); ?>

    This will add next and previous post buttons.

    #46658

    Hey thanks for your reply.. I am having trouble finding where I need to replace this?

    Here is my single.php.

    (removed to avoid formatting issues – Dude)

    Many Thanks,

    #46659

    I adjusted the code above.

    #46660

    Thank you so much! That works a treat :)

    http://www.benrobins.com/fiat-500-and-500c-bydiesel/

    As you can see it has added the ‘Next : Previous’ Links at the bottom of the posts. I was wondering if there was a way to have these appear above the main lightbox image, in the same style as where it says ‘Produced at RealtimeUK for AKQA’ but justified to the right? That would be perfect!!

    The style of the line of text is a custom value I have added to the posts ‘punchline’.

    If this cant be achieved easily, I would like to be have the Next & Previous links to remain at the bottom but be justified to the right?

    Any help appreciated..

    Thank you.

    #46661

    Mmm….try to replace:

    echo $preview; // echo the preview image

    with:

    previous_post_link('<h6 style="float:right;">%link</h6>', 'Next project', TRUE); ?>
    <?php next_post_link('<h6 style="float:right;">%link</h6>', 'Next project', TRUE); ?>
    echo $preview; // echo the preview image

    #46662

    Thank you for all your help so far :)

    I have tweaked it to best suit my site and almost have it working exactly how I want it to.

    Functionality wise it is perfect, I just need to tweak aesthetics now!

    I have slightly edited the code you gave me, this is what I am using.

    echo $preview; // echo the preview image

    the_content(‘Read more’);

    previous_post_link(‘<h6 style=”float:right;”>%link</h6>’, ‘Next project’, TRUE); ?>

    <?php next_post_link(‘<h6 style=”float:left;”>%link</h6>’, ‘Previous project’, TRUE); ?>

    If you take a look at one of the portfolio posts, such as: http://www.benrobins.com/dirt-3-game-trailer/ you can see the ‘Previous & Next’ links at the bottom aligned to the right and left. The only thing is, they are not on the same line! If this could be resolved so that they are both on the same line whilst remaining aligned right and left as there are now that would be perfect!

    The other small issue is I would like these two links to always appear with a line above them to separate them somewhat from the post. To achieve this currently I have to add a ul /ul to the bottom of the post. If this could be achieved automatically that would be brilliant.

    Many Thanks, Nearly there :)

    #46663

    I really hope this is achievable, this is the only thing left I would like to change on my site..

    Any help really appreciated!

    Ben

    #46664

    I just wanted to say that I think I have solved my issue by using the following code..

    ‘echo $preview; // echo the preview image

    the_content(‘Read more’); ?>

    <div style=”width:860px;”>

    <span style=’float: right;’>

    <?php previous_post_link(‘<h6>%link</h6>’, ‘Next project’, TRUE); ?></span>

    <span style=’float: left;’>

    <?php next_post_link(‘<h6>%link</h6>’, ‘Previous project’, TRUE); ?></span>

    </div>’

    :)

    #46665

    Glad that you found a solution :)

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

The topic ‘Adding 'Next' & 'Previous' navigation links to individual Portfolio posts?’ is closed to new replies.