Created
June 21, 2012 08:18
-
-
Save deckerweb/2964538 to your computer and use it in GitHub Desktop.
Genesis Single Post Navigation -- constants and filters for customizing and branding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // since plugin version v1.5: | |
| // Constants: | |
| /** | |
| * Genesis Single Post Navigation: Reverse link direction | |
| */ | |
| define( 'GSPN_REVERSE_LINK_DIRECTION', TRUE ); | |
| // Filters: | |
| /** | |
| * Customize previous post link: | |
| * @link https://gist.github.com/1576197 | |
| */ | |
| /** | |
| * Customize next post link: | |
| * @link https://gist.github.com/1576203 | |
| */ | |
| /** Customizing the whole tooltip output: */ | |
| 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' ); | |
| } | |
| 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' ); | |
| } | |
| 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; | |
| } | |
| 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; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: The above codes work with plugin version 1.5 or higher!
Extended explanation can be found at the plugin's page "FAQ" section at the bottom:
http://wordpress.org/extend/plugins/genesis-single-post-navigation/faq/
Download "Genesis Single Post Navigation" plugin at wordpress.org:
http://wordpress.org/extend/plugins/genesis-single-post-navigation/