[Resolved] Secondardy menu doubled up/sticky?

Home Forums Support [Resolved] Secondardy menu doubled up/sticky?

Home Forums Support Secondardy menu doubled up/sticky?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1182705
    William

    Hi there,
    I see the primary menu can be sticky – can the secondary menu be sticky?

    Also, is it possible to have the secondary menu located twice on the site?

    Many thanks,

    Will

    #1182764
    David
    Staff
    Customer Support

    Hi there,

    1. Sticky Secondary Nav – try this CSS:

    .secondary-navigation {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
    }

    You’ll have to adjust your sticky sidebar position to compensate for the stick nav.

    2. The menu can be added to a Widget Area – using the nav widget

    #1182803
    William

    Hello,
    Thank you for this – perfect. Is there a way to have the same animations if I would like as with the primary sticky?
    Also, for mobile, the menu, when closed, appears as ‘Menu’. Is it possible to change this to ‘Explore %category%’?
    Many thanks,
    Will

    #1183779
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    The same animations aren’t available at the moment, unfortunately.

    You can change the mobile menu label in Customize > Layout > Secondary Navigation.

    #1185089
    William

    Hi there,

    Thanks for this – is there a way to make the mobile menu ‘Explore %category%’ where %category% is the category of the post the menu appears on?

    Kind regards,
    Will

    #1185408
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You might be able to do this:

    add_filter( 'option_generate_secondary_nav_settings', function( $settings ) {
        $category = get_the_category();
    
        if ( $category ) {
            $settings['secondary_nav_mobile_label'] = 'Explore ' . $category[0]->cat_name;
        }
    
        return $settings;
    } );
    #1186138
    William

    Hello,
    Where abouts do I add this? I tried as Additional CSS on customize but that does not seem to work.
    Kind regards,
    Will

    #1186318
    David
    Staff
    Customer Support

    Its PHP – this article explains:

    https://docs.generatepress.com/article/adding-php/

    #1186374
    William

    Hi there,
    Thanks for this – I’ve added the code but nothing seems to have changed?
    Kind regards,
    Will

    #1186527
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It looks like it’s working. Maybe try clearing your browser cache?

    I checked out a few single posts and the category name is showing.

    #1186695
    William

    Ah yes, you’re right, sorry about that.
    Thanks very much!

    #1187222
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

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