- This topic has 21 replies, 3 voices, and was last updated 2 years, 7 months ago by
David.
-
AuthorPosts
-
March 2, 2023 at 3:40 am #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” xmlns:xlink=”http://www.w3.org/1999/xlink” 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.
March 2, 2023 at 6:28 am #2552671David
StaffCustomer SupportHi there,
the hook is working as i can see the HTML, but the SVG has an issue.
Where did you get the SVG from ?March 2, 2023 at 6:39 am #2552679huppap
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.
March 2, 2023 at 6:41 am #2552682huppap
I even tested the svg icon you mentioned here with same issue.
March 2, 2023 at 6:44 am #2552685huppap
on this link I mean
https://generatepress.com/forums/topic/icon-my-account-menu-bar/March 2, 2023 at 8:01 am #2552925David
StaffCustomer SupportHmmm… try adding this CSS:
.menu-bar-item a svg { width: 1.5em; height: 1.5em; }March 2, 2023 at 8:14 am #2552947huppap
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?
March 2, 2023 at 8:40 am #2552979huppap
I could live with the color, but could you please help me align these?
March 2, 2023 at 10:05 am #2553078David
StaffCustomer SupportWhere can i see the issue ?
March 2, 2023 at 10:16 am #2553094huppap
sorry, you should be able to see it now on dec site.
March 2, 2023 at 1:32 pm #2553303David
StaffCustomer SupportThe 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; }March 2, 2023 at 8:57 pm #2553542huppap
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?
March 2, 2023 at 8:59 pm #2553543huppap
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?
March 3, 2023 at 3:00 am #2553794David
StaffCustomer SupportTry 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; }March 3, 2023 at 3:25 am #2553817huppap
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.
-
AuthorPosts
- You must be logged in to reply to this topic.