Site logo

Archived topic

Secondary Off Canvas Panel

18 replies · Started by generatepressiscool on July 22, 2020

Viewing posts 16–19 of 19

I added it, but instead of replacing the "Menu" name it adds an additional line on top as the category name.

If I remove the Mobile Menu Label in customiser, then the entire menu disappears.

Ok remove the hook and add this PHP Snippet to your site:

add_filter( 'option_generate_secondary_nav_settings','lh_single_posts_secondary_nav_settings' );
function lh_single_posts_secondary_nav_settings( $options ) {
    $category = get_the_category(); 
    $category_label = $category[0]->cat_name;
    if ( !empty( $category ) ) {
      $options['secondary_nav_mobile_label'] = $category_label;
    }
    
    return $options;
}

Works perfectly. Thank you!

I will mark this topic as resolved, since the original question has been answered.

Glad to be of help.
And thanks for sharing your solution.

This archived topic is closed to new replies.