[Resolved] Secondary Off Canvas Panel

Home Forums Support [Resolved] Secondary Off Canvas Panel

Home Forums Support Secondary Off Canvas Panel

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #1374708
    generatepressiscool

    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.

    #1374909
    David
    Staff
    Customer Support

    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;
    }
    #1374940
    generatepressiscool

    Works perfectly. Thank you!

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

    #1374960
    David
    Staff
    Customer Support

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

Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.