- This topic has 16 replies, 3 voices, and was last updated 4 years, 8 months ago by Tom.
-
AuthorPosts
-
August 19, 2019 at 4:42 am #987736Paul
Hello,
I want the fa fa-user icon to display next to the cart icon.. outside of the main menu.
not like this.. (https://docs.generatepress.com/article/adding-icons-to-menu-items/#floating-the-icon-to-the-right)
How would I achieve this? I tried searching for ways and I found one solution but it only worked on mobile menus.. Would like the icon to be displayed on both displays.. Just as the Cart icon does. Please let me know.
Thanks.
Peery
August 19, 2019 at 6:40 am #987817DavidStaffCustomer SupportHi there,
For the Mobile Menu you can add your link/icon HTML using the
inside_mobile_menu_bar
hook.
That article should work fine for desktop, just place it as the last item in the menu. you can also add thehide-on-mobile
CSS class to remove it from the mobile menu dropdown.August 19, 2019 at 7:09 am #987840PaulThen that would not show up like the Cart icon on mobile… the Account icon would be in the drop down menu.. Right?
August 19, 2019 at 7:19 am #987846DavidStaffCustomer SupportNo – the hook will place it in the the container that the Cart icon is displayed. The second part will add it to desktop menu and hide it from the mobile dropdown menu.
August 19, 2019 at 7:50 am #988000PaulOk ok.. I got what you saying now.. Thanks π Working on it now will update.
August 19, 2019 at 7:57 am #988010PaulHey can you check it please… Icon shows up when you visit homepage but when you start going to other pages icon goes away.. I have still not added the hook yet for mobile though.. Only working on desktop right now.. Thanks! also.. been watching the other articles today.. u been on it π tell em u need raise π
August 19, 2019 at 7:57 am #988011DavidStaffCustomer SupportCool – glad to be of help
August 19, 2019 at 8:00 am #988013Paullet me know if you can see icon on any other page than the home page please. desktop version
August 19, 2019 at 8:01 am #988014DavidStaffCustomer SupportThe issue is because the FA icons are being loaded by Elementor – which is not present on the other pages. Theres a few workaround.
Easiest one, are you intending to add any social icons or other Elementor designed content across your site? If so you then by hooking in or using widgets containing an elementor template will force the FA icon to load. Let us know
August 19, 2019 at 8:09 am #988023PaulOk i got it now.. Just put it in the footer for now… Will display:none that one or something else later on π Thanks for all the help.. now I work on the hook.
August 19, 2019 at 8:12 am #988030DavidStaffCustomer SupportYou’re welcome.
August 19, 2019 at 8:23 am #988046PaulI lost the forum post when I found the hook code…
This is what I got though..
add_action( 'generate_inside_mobile_header_menu','my_account_mobile_menu' ); function my_account_mobile_menu() { ?> <i class="fa fa-user my-account-mobile-menu" aria-hidden="true"></i> <?php }
showing in a weird place though. please let me know. thanks.
August 19, 2019 at 9:22 am #988102PaulI had the hook working earlier before i posted this forum.. Cant seem to get it working now..
August 19, 2019 at 2:29 pm #988325Pauladd_action( 'generate_inside_mobile_header','my_account_mobile_menu' ); function my_account_mobile_menu() { ?> <div class="mobile-bar-items"> <a title="My Account" href="#"><i class="fa fa-user"></i></a> </div> <?php }
works.. π but.. user icon is on right side of cart icon on mobile.. and on left side of cart icon on desktop…
here is forum – https://generatepress.com/forums/topic/add-my-account-link-in-main-navigation/
August 19, 2019 at 4:05 pm #988365TomLead DeveloperLead DeveloperHi there,
Try adding this CSS:
.nav-aligned-right .main-navigation .menu > li.hide-on-mobile { float: right; }
-
AuthorPosts
- You must be logged in to reply to this topic.