[Resolved] Is possible to add content into the sticky menu?

Home Forums Support [Resolved] Is possible to add content into the sticky menu?

Home Forums Support Is possible to add content into the sticky menu?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #322903
    Roberto Enrique

    Hi!

    I need to add a couple of links into the sticky menu like here:

    Sticky Icons

    Is there a hook or something for that?

    Thanks in advance.

    #322909
    Leo
    Staff
    Customer Support
    #322916
    Tom
    Lead Developer
    Lead Developer

    Are you only wanting to add them into the mobile menu, or the desktop menu as well?

    #322921
    Roberto Enrique

    I just need them to be on the mobile/sticky.

    If you want to see the issue “live” take a look at the website:

    https://www.officinadellozio.com

    I’m using some “hacks” to do the menu like that:

    I’m using the slide menu for the main nivigation and the mainmenu as a dummy one to display the cart/login links.

    As they do not display on mobile I would like to add a cart/login icon beside the hamburger icon in the sticky

    Unfortunately, if I add the search to the menu all the layout for the sticky goes crazy.

    Any other advice is well accepted.

    Thanks in advance.

    #322922
    Tom
    Lead Developer
    Lead Developer

    Try this:

    add_action( 'generate_inside_navigation','tu_inside_mobile_navigation' );
    function tu_inside_mobile_navigation() {
    ?>
        <div class="mobile-bar-items">
            Your stuff in here
        </div>
    <?php
    }
    #322938
    Roberto Enrique

    That feels a lot better, thanks πŸ™‚

    Is possible to display it just in the sticky menu?

    My css is struggling…

    #323116
    Tom
    Lead Developer
    Lead Developer

    Add another class to your element: <div class="mobile-bar-items my-custom-area">

    Then some CSS:

    .main-navigation:not(.navigation-stick) .my-custom-area {
        display: none;
    }
    #323520
    Roberto Enrique

    Awesome!
    Thanks πŸ™‚

    #323600
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    #1801282
    Janos

    Dear Team!

    I tried the snippets above, but unfortunatelly not worked for me.

    I’d like to add the Fibo Search bar to the mobile menu header near the WooCommerce shopping cart, and to the sticky menu (desktop and mobile too).

    Thanks your help!

    #1801428
    David
    Staff
    Customer Support

    Hi there,

    this is a really old topic… lots has changed since then.

    Instead you can create a new Block Element:

    https://docs.generatepress.com/article/block-element-overview/

    Add a shortcode block for your search plugins shortcode.
    Set the Hook to: generate_menu_bar_items
    Set the Display Rules to Entire Site.

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