[Resolved] Labeling the mobile menu based on category base?

Home Forums Support [Resolved] Labeling the mobile menu based on category base?

Home Forums Support Labeling the mobile menu based on category base?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #392672
    Paul

    Hi, is it possible somehow to name my mobile menu label differently based on which category the user is in?

    If yes, what would be the best way to do this?

    #392990
    Tom
    Lead Developer
    Lead Developer

    You could do something like this:

    add_filter( 'generate_mobile_menu_label', 'tu_category_mobile_toggle_text' );
    function tu_category_mobile_toggle_text( $label ) {
        if ( is_category( 'Sample Category' ) ) {
            return 'Sample toggle';
        }
    
        if ( is_category( 'Another Category' ) ) {
            return 'Another toggle';
        }
    
        return $label;
    }
    #393011
    Paul

    That’s great. Thanks Tom.

    #393040
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #492769
    elsa

    Hi Tom,
    How to add it on page header setting since my header has the logic of classification? Also how to enlarge the font?

    #492998
    Leo
    Staff
    Customer Support

    Hi there,

    I don’t think your question is related to mobile label so please open a new topic.

    Thanks!

    #493324
    elsa

    Hi Leo,
    It is related to mobile menu label. Let me clarify. So what I’m trying to achieve is to have 2 different mobile label for different pages. Tom suggested to use conditional tag, but is it possible to put the coding on page header setting? Since mobile menu is part of the header (on mobile header). Also I don’t need to use conditional tag because I will assign the header setting by page.

    #493369
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I’m afraid that wouldn’t be possible currently using the Page Header module.

    #493371
    elsa

    Hi Tom,
    Thanks for the info. How to enlarge mobile menu label? Thank you.

    #493374
    Leo
    Staff
    Customer Support

    We can use CSS for that. Can you open a new topic? thanks!

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.