WordPress.org

Ready to get started?Download WordPress

Forums

Smarter Navigation
[resolved] browsing with just arrows instead of title? (3 posts)

  1. omniafausta
    Member
    Posted 1 year ago #

    Hi, I love this plugin, but I want to change something and I haven't a clue how. Hope someone can help!
    I have inserted the code in my template, and it now shows the titles of the previous and next posts.
    But i only want to show arrows for previous and next.
    Like this: ◄ ►(a bit like the butons on a cd-player)
    But I cannot remove the part that says %link, because the arrows are not part of the link.
    I hope you understand what I mean, and I hope you can tell met what to do!
    Thanks!!

    http://wordpress.org/extend/plugins/smarter-navigation/

  2. omniafausta
    Member
    Posted 1 year ago #

    ok, I found something in the code of the plugin that is probably of importance:
    $link = sprintf( "<a href='%s'>%s</a>", get_permalink( $id ), $title );
    the %s part calls the permalink I think, where i would want an arrow either to the left or to the right, depending on wether it is next or previous...
    But, first of all I do not want to edit the plugin itself (because of potential updates). So I guess i need something in my functions.php that replaces that line with something else?
    And second of all, I wouldn't know what kind of if / else stuff I would have to put in there to make it work.

    Someone please help? thanks

  3. omniafausta
    Member
    Posted 1 year ago #

    Ok it was a lot easier than I feared!
    With help from a friend I came to the following solution:
    putting this in my template, gave the output I wanted:

    next_post_smart( '%link', '◄' );
    previous_post_smart( '%link', '►' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.