Forums

[resolved] Next/Previous Link as Image (5 posts)

  1. junodx
    Member
    Posted 1 year ago #

    Hello,

    I need to replace my "previous" and "next" navigation buttons to images. I read other posts regarding this issue and it's not working for some reason.

    This is how my navigation php page looks like:

    <?php if (is_single()) : ?>

    <div class="navigation">
    <p class="previous"><?php previous_post_link('← %link') ?></p>
    <p><?php next_post_link('%link →') ?></p>
    </div>

    <?php else : ?>

    <div class="navigation">
    <p><span class="older"><?php next_posts_link('← Previous Entries') ?></span><?php previous_posts_link('Next Entries →') ?></p>
    </div>

    <?php endif; ?>

  2. rachaely
    Member
    Posted 1 year ago #

    Style the links to have background images? That would be one way of doing it.

  3. alchymyth
    The Sweeper
    Posted 1 year ago #

  4. junodx
    Member
    Posted 1 year ago #

    @alchymyth Ok it seems like the image navigation appears when following the instructions on both of the links you provided. However, the links are linking to the wrong page.
    Not sure what I am doing wrong here.

  5. alchymyth
    The Sweeper
    Posted 1 year ago #

    have you set the $in_same_cat parameter the way you need it?

    http://codex.wordpress.org/Function_Reference/next_post_link
    http://codex.wordpress.org/Function_Reference/previous_post_link

    is it possible, that there is some custom query between the post and the navigation?
    in which case you may need to add 'wp_reset_query();' before the link code.
    http://codex.wordpress.org/Function_Reference/wp_reset_query

    can you post your whole code ?
    (use a pastebin http://wordpress.pastebin.com/ for code longer than a few lines)

    a link to your site might help to illustrate the issue.

Topic Closed

This topic has been closed to new replies.

About this Topic