Site logo

[Support request] Menu Bar Icon Not Showing

Home Forums Support [Support request] Menu Bar Icon Not Showing

Home Forums Support Menu Bar Icon Not Showing

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #2552466
    huppap

    Hi I am trying to add menu bar icon and I have followed this article

    https://docs.generatepress.com/article/generate_menu_bar_items/

    But after adding the menubar icon it does not show on the frontend for some reason.

    Although you can clearly inspect element on it. I am using this code and showing it on entire site using “generate_menu_bar_items” hook element

    <span class=”menu-bar-item”>

    <svg version=”1.1″ class=”account-icon” xmlns=”
    http://www.w3.org/2000/svg&#8221; xmlns:xlink=”http://www.w3.org/1999/xlink&#8221; x=”0px” y=”0px” viewBox=”0 0 120 120″ enable-background=”new 0 0 120 120″ xml:space=”preserve”><path d=”M84.6,62c-14.1,12.3-35.1,12.3-49.2,0C16.1,71.4,3.8,91,3.8,112.5c0,2.1,1.7,3.8,3.8,3.8h105c2.1,0,3.8-1.7,3.8-3.8 C116.2,91,103.9,71.4,84.6,62z”></path><circle cx=”60″ cy=”33.8″ r=”30″></circle></svg>

    </span>

    website is added on the private information area where you can check this.

    Thank you.

    #2552671
    David
    Staff
    Customer Support

    Hi there,

    the hook is working as i can see the HTML, but the SVG has an issue.
    Where did you get the SVG from ?

    #2552679
    huppap

    what is the issue with svg icon you see?

    I got it from the live site, you can live site at www. instead of dev.

    #2552682
    huppap

    I even tested the svg icon you mentioned here with same issue.

    #2552685
    huppap
    #2552925
    David
    Staff
    Customer Support

    Hmmm… try adding this CSS:

    .menu-bar-item a svg {
        width: 1.5em;
        height: 1.5em;
    }
    #2552947
    huppap

    I applied it, and it looks kind of funny, and it seems to have changed the color and size for search bar icon too, I wonder why did that happen?

    #2552979
    huppap

    I could live with the color, but could you please help me align these?

    #2553078
    David
    Staff
    Customer Support

    Where can i see the issue ?

    #2553094
    huppap

    sorry, you should be able to see it now on dec site.

    #2553303
    David
    Staff
    Customer Support

    The alignment issue stems from the cart icon not having any padding.
    Try this CSS to correct that:

    .cfw_cart_icon_shortcode {
        padding: 15px 15px 25px;
    }
    
    .main-navigation .menu-bar-items {
        position: relative;
        bottom: -5px;
    }
    #2553542
    huppap

    I applied this css and icons seem to be bit too far apart, could you help me being them closer as you see them on live site, and in that order please?

    this is their documentation for adding side cart icon to places. Maybe we can choose a better approach?

    https://www.checkoutwc.com/documentation/side-cart/

    #2553543
    huppap

    also is possible to separate navigation from those icons and align navigation to the centre and search and account and cart icons to the right?

    #2553794
    David
    Staff
    Customer Support

    Try this CSS to improve spacing:

    .menu-bar-items a {
        padding: 15px 10px !important;
    }
    .menu-bar-items .search-item a {
        position: relative;
        bottom: 2px;
    }

    And this CSS to center nav:

    #site-navigation {
        flex: 1;
    }
    #site-navigation  #primary-menu {
        margin: auto;
    }
    #2553817
    huppap

    Hi Dave, this is perfect, thank you.

    Could you also help me arrange menu icons in the header in this order, please.

    on Desktop – Search, Account, Cart
    on Mobile – Menu Toggle, Search, Logo, Account, Cart (as you see on live site).

    This will conclude header for me.

    Thank you.

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