WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Genesis Single Post Navigation

Plugin adds next & prev nav links on single posts to have a "browse post by post nav style". Use of Genesis Theme Framework is required.

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 override them via your child theme. In most cases you then have to apply them by adding an !important to the appropiate rule.

Second alternative (HIGHLY recommended!):

(1) Add a stylesheet file gspn-additons.css to your active 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 GSPN stylesheet gspn-styles.css to your active 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 extra .css files 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 child theme or a functionality plugin. (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:

/**
 * Genesis Single Post Navigation: Reverse link direction
 */
define( 'GSPN_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 also will 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( 'gspn_previous_post_link', 'custom_gspn_previous_link' );
/**
 * Genesis Single Post Navigation: Add custom filters for "previous post link"
 */
function custom_gspn_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( 'gspn_next_post_link', 'custom_gspn_next_link' );
/**
 * Genesis Single Post Navigation: Add custom filters for "next post link"
 */
function custom_gspn_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 4 filters available:

gspn_filter_previous_post_string

  • Default value: Previous post:
  • Example code:
add_filter( 'gspn_filter_previous_post_string', 'custom_gspn_filter_previous_post_string' );
/** Genesis Single Post Navigation: Custom Previous Tooltip String */
function custom_gspn_filter_previous_post_string() {
    return __( 'Custom previous post:', 'your-child-theme-text-domain' );
}

gspn_filter_next_post_string

  • Default value: Next post:
  • Example code:
add_filter( 'gspn_filter_next_post_string', 'custom_gspn_filter_next_post_string' );
/** Genesis Single Post Navigation: Custom Next Tooltip String */
function custom_gspn_filter_next_post_string() {
    return __( 'Custom next post:', 'your-child-theme-text-domain' );
}

gspn_filter_previous_post_tooltip (the whole tooltip, including get_adjacent_post() function!)

  • Default value: 'Previous post:' PLUS title of previous post
  • Example code:
add_filter( 'gspn_filter_previous_post_tooltip', 'custom_gspn_previous_post_tooltip_output' );
/** Genesis Single Post Navigation: Custom Previous Tooltip Output */
function custom_gspn_previous_post_tooltip_output() {
    $gspn_custom_previous_data = get_adjacent_post( false, '', true );
    $gspn_custom_previous = __( 'Custom previous post:', 'your-child-theme-text-domain' ) . ' ' . esc_attr( get_the_title( $gspn_custom_previous_data ) );
    return $gspn_custom_previous;
}

Note, for parameters of the get_adjacent_post() function, see the WordPress Codex

gspn_filter_next_post_tooltip (the whole tooltip, including get_adjacent_post() function!)

  • Default value: 'Next post:' PLUS title of next post
  • Example code:
add_filter( 'gspn_filter_next_post_tooltip', 'custom_gspn_next_post_tooltip_output' );
/** Genesis Single Post Navigation: Custom Next Tooltip Output */
function custom_gspn_next_post_tooltip_output() {
    $gspn_custom_next_data = get_adjacent_post( false, '', false );
    $gspn_custom_next = __( 'Custom next post:', 'your-child-theme-text-domain' ) . ' ' . esc_attr( get_the_title( $gspn_custom_next_data ) );
    return $gspn_custom_next;
}

Note, for parameters of the get_adjacent_post() function, see the WordPress Codex

Final note: If you don't like to add your customizations to your 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 child theme changes etc.

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

Requires: 3.2 or higher
Compatible up to: 3.4.2
Last Updated: 2012-6-21
Downloads: 11,804

Ratings

4 stars
4.4 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,2,2 100,3,3 100,1,1 100,1,1
100,1,1 100,2,2 100,3,3 100,4,4
100,3,3 100,6,6 100,4,4
75,4,3 100,4,4
100,4,4 100,4,4
100,5,5
100,2,2
100,4,4
100,1,1
50,2,1