WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

WP Single Post Navigation

Plugin adds next & prev nav links on single posts to have a "browse post by post nav style". Includes customizeable parameters.

The link styles don't fit to my site and/or are invisible - what should I do?

Don't panic. It's just some css styling - look at the next questions on how you can edit this. Thank you! (The plugin comes only with one pre-defined style so it cannot fit with any site by default. Thank you for your understanding!)

Can I change the color of the links and/or the link hover behaviour?

Yes, you can!

First alternative: Just look in the packaged CSS file single-post-navigation.dev.css to find out the CSS selectors and rules and then overwrite them via your theme/child theme. In most cases you then have to apply them by adding an !important to the appropiate rule.

Second alternative (HIGHLY recommeded!):

(1) Add a print stylesheet file wpspn-additons.css to your active theme's/child theme's root folder and you're done. It will be automatically enqueued after the packaged plugin styles so you are able to override them.

(2) To not use the packaged plugin stylesheet at all just add your full own custom WPSPN stylesheet wpspn-styles.css to your active theme's/child theme's root folder and you're done. This will be properly enqueued then and NOT the plugin file.

Both ways are really easy and update-secure. Enjoy!

Can I remove or change the styling of the tiny border lines?

Yes, of course! Just the same procedure as above! Look for the documented style settings in the css file. - The alternative via theme/child theme is always recommended :)

Can I adjust the media query for another display size (or even various sizes) because my site or content width is bigger/ smaller?

Again, that's possible! Just the same procedure as above! Look for the documented style settings in the css file. - The alternative via extra .css files is always recommended :)

Can I swap/reverse the direction of the browsing links?

Finally, this is now possible since version 1.4+ of the plugin :). You only have to add one little line of code (a constant) to the functions.php file of your theme or child theme. (Only add this if you really want to change the direction of the links & arrows, if not then just DO NOT add it!) Please add the following code:

/**
 * WP Single Post Navigation: Reverse link direction
 */
define( 'WPSPN_REVERSE_LINK_DIRECTION', TRUE );

Please note: This leads to changing the general direction of the links, really book-like ("next post link" on the right side, "previous post link" on the left side). It will also lead to reversed arrows (the linked strings)!

Can I customize the link string, set to only in the same category and can I exclude categories?

Yes, this is now possible since version 1.4+ of the plugin via custom filters which you can add to your functions.php file of the current theme or child theme. -- There's one filter function for each of the two - "previous post link" and "next post link":

Changing parameters for "previous post link":

add_filter( 'wpspn_previous_post_link', 'custom_wpspn_previous_link' );
/**
 * WP Single Post Navigation: Add custom filters for "previous post link"
 */
function custom_wpspn_previous_link() {

    $args = array (
        'format'                => '%link',     // Change link format (default: %link)
        'link'                  => '»',   // Change link string (default: »)
        'in_same_cat'           => FALSE,       // Apply only to same category (default: FALSE)
        'excluded_categories'   => ''           // Exclude categories (default: empty)
    );

    previous_post_link( $args['format'], $args['link'], $args['in_same_cat'], $args['excluded_categories'] );
}

You can also get this code from GitHub Gist here // See also WordPress codex for info on the four possible parameters...

If you reversed the link direction (see above FAQ entry) you might change the link string here to: «

Changing parameters for "next post link":

add_filter( 'wpspn_next_post_link', 'custom_wpspn_next_link' );
/**
 * WP Single Post Navigation: Add custom filters for "next post link"
 */
function custom_wpspn_next_link() {

    $args = array (
        'format'                => '%link',     // Change link format (default: %link)
        'link'                  => '«',   // Change link string (default: «)
        'in_same_cat'           => FALSE,       // Apply only to same category (default: FALSE)
        'excluded_categories'   => ''           // Exclude categories (default: empty)
    );

    next_post_link( $args['format'], $args['link'], $args['in_same_cat'], $args['excluded_categories'] );
}

You can also get this code from GitHub Gist here // See also WordPress codex for info on the four possible parameters...

If you reversed the link direction (see above FAQ entry) you might change the link string here to: »

Can I customize the tooltip output?

Yes, this is possible since plugin version 1.5 or higher. There are two filters available:

wpspn_filter_previous_post_tooltip

  • Default value: 'Previous post:' plus title of previous post
  • Example code:
add_filter( 'wpspn_filter_previous_post_tooltip', 'custom_wpspn_previous_post_tooltip_output' );
/** WP Single Post Navigation: Custom Previous Tooltip Output */
function custom_wpspn_previous_post_tooltip_output() {
    return __( 'Custom previous post:', 'your-text-domain' );
}

wpspn_filter_next_post_tooltip

  • Default value: 'Next post:' plus title of next post
  • Example code:
add_filter( 'wpspn_filter_next_post_tooltip', 'custom_wpspn_next_post_tooltip_output' );
/** WP Single Post Navigation: Custom Next Tooltip Output */
function custom_wpspn_next_post_tooltip_output() {
    return __( 'Custom next post:', 'your-text-domain' );
}

Final note: If you don't like to add your customizations to your theme's/child theme's functions.php file you can also add them to a functionality plugin or an mu-plugin. This way you can also use this better for Multisite environments. In general you are then more independent from theme/child theme changes etc.

All the custom & branding stuff code above can also be found as a Gist on Github: https://gist.github.com/2961493 (you can also add your questions/ feedback there :)

Requires: 3.0 or higher
Compatible up to: 3.4.2
Last Updated: 2012-6-20
Active Installs: 5,000+

Ratings

4.8 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1 100,1,1
100,1,1 80,10,8 100,1,1 100,1,1 100,1,1
100,3,3 100,1,1 100,2,2 100,3,3 100,3,3
100,2,2 100,6,6 100,3,3
86,7,6 100,4,4
100,4,4 100,5,5
100,7,7
75,4,3
100,4,4
0,1,0
100,2,2
0,1,0