• So, I’ve customized my prev/next links.

    <div id="nav-below" class="navigation">
    <div class="nav-previous"><?php previous_post_link('%link', '%title', 'in_same_cat', TRUE); ?></div>
    <div class="nav-next"><?php next_post_link('%link', '%title', 'in_same_cat', TRUE); ?></div>
    </div><!-- #nav-below -->

    And now I’m targeting them via css;
    ie .nav-revious has a background image and so does .nav-next.
    Think big arrows pointing left and right.

    So now when I get to my first post in my series, even though there isn’t a previous link, my background-image is still showing up on my div, if there an easy if statement to put in somewhere to hide the div if there’s no content? ie if no content display:hidden .nav-previous

    I’ve tried the search on these forums and some google pages to no avail.

    Thanks for your help! 😀

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Kathryn Presner

    (@zoonini)

    Try taking the background image off your div and doing something like this way instead:

    <?php next_post_link('%link', 'Next in category <img src="/images/next.gif" alt="next in category" width="18" height="12" />', TRUE); ?>

    Add the background image to the a tag rather than the div itself – eg:

    .nav-revious a {background...}

    Thread Starter thoughtpalettechris

    (@thoughtpalettechris)

    The still needs to be on top of the image zoonini, but thats a good way as well, I should’ve been clearer :}

    I’ll try your way esmi, seem’s like that might be what I need to do.

    Thank you both for the fast solutions!

    This forum needs a +karma option

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Prev/Next Advanced selector’ is closed to new replies.