Site logo

Archived topic

woo My Account icon in nav

16 replies · Started by Peery on August 19, 2019

Viewing posts 1–15 of 17

Hi 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 the hide-on-mobile CSS class to remove it from the mobile menu dropdown.

Then that would not show up like the Cart icon on mobile... the Account icon would be in the drop down menu.. Right?

No - 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.

Ok ok.. I got what you saying now.. Thanks :) Working on it now will update.

Hey 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 :)

Cool - glad to be of help

let me know if you can see icon on any other page than the home page please. desktop version

The 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

Ok 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.

You're welcome.

I 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.

I had the hook working earlier before i posted this forum.. Cant seem to get it working now..

add_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/

Hi there,

Try adding this CSS:

.nav-aligned-right .main-navigation .menu > li.hide-on-mobile {
    float: right;
}
This archived topic is closed to new replies.