Last active
February 17, 2016 22:24
-
-
Save generatepress/818c2eb3a5ef5a5ca47d to your computer and use it in GitHub Desktop.
Change Secondary Navigation label depending on category
This file contains 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
add_action( 'init','generate_secondary_nav_label' ); | |
function generate_secondary_nav_label() | |
{ | |
if ( function_exists( 'generate_secondary_nav_get_defaults' ) ) : | |
$generate_settings = wp_parse_args( | |
get_option( 'generate_secondary_nav_settings', array() ), | |
generate_secondary_nav_get_defaults() | |
); | |
endif; | |
if ( is_category( 'Your Category Name' ) ) { | |
$generate_settings['secondary_nav_mobile_label'] = 'Custom Nav Label'; | |
} | |
if ( is_category( 'Another Category' ) ) { | |
$generate_settings['secondary_nav_mobile_label'] = 'Another label'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment