Skip to content

Instantly share code, notes, and snippets.

@generatepress
Last active February 17, 2016 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save generatepress/818c2eb3a5ef5a5ca47d to your computer and use it in GitHub Desktop.
Save generatepress/818c2eb3a5ef5a5ca47d to your computer and use it in GitHub Desktop.
Change Secondary Navigation label depending on category
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