-
Author
-
September 20, 2015 at 10:28 #78606ImGParticipant
I have added custom link “FAQ” to “My account” menu item in the social header. When the user is logged out “My account” menu item disappears but that custom link “FAQ” is appearing in the drop-down. I want to hide that custom link when the user is logged out. Since i already installed many plugins i don’t want to use any plugin for this problem. Any solution!
September 21, 2015 at 11:51 #78669LauraModeratorHello, we could try with css, can you share a link? 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
September 21, 2015 at 22:02 #78822LauraModeratorHello, please add this to header.php of child theme
COPY CODE<?php if ( is_user_logged_in() ) { } else { ?> <style type="text/css" media="screen"> li#menu-item-3112 { display: none !important; } </style> <?php } ?>
Let me know if it works 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
September 22, 2015 at 17:03 #78904ImGParticipantHi @laura, It works great! but i have two questions
1. Whenever header.php is updated i need to copy the updated header.php to paste in kleo child theme and also i need to include the code given by you for each update of header.php. So can you please provide me the code which does the same function from functions.php of child theme to avoid repeated work because of update?
2. If i want to include one more menu item under “My Account” means, whether i need to include the menu item id in new set of code or any possibility to include the id in already existing set of codes?
Thank you for your continual support.
September 22, 2015 at 20:47 #79016LauraModeratorHello, in the child theme you should have a header.php empty if not copy the main file and paste it there. Right not there is no function for that.
Yes, if you want to hide any other menu item just add it to the code like:COPY CODEli#menu-item-3112 { display: none !important; }
Inside the <style> </style> where the other one is
Just change the menu item idHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
September 23, 2015 at 15:57 #79115ImGParticipantHi @laura, I’m not able to understand your answer for the first question, i already copied parent theme header.php to child theme, then at the end in that copied file i have added the code given by you. Now my problem is whenever header.php of parent theme is updated i need copy that header.php to child theme for all future updates and i have to include the code given by you in copied header.php for each update, Any solution for avoiding future work during update?
September 24, 2015 at 05:10 #79287LauraModeratorHello, i dont think you would need to update the header.php but if its needed then you will have to, but that is how the child theme works.
Again, i dont think you will need to do thatHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
September 24, 2015 at 20:13 #79386mtgame21ParticipantIf I understand your problem correctly, I had a similar problem and noticed that if there was no sub menu under “My Account” menu it, it would not appear if the user was logged out. Once they logged in, the “My Account” menu item would appear in the menu bar. If you added a sub-menu item under “My Account”, then “My Account” and the sub-menu item would appear even if the user was not logged in.
My solution was to use a plugin called “Nav Menu Roles” which made it very easy to control visibility of the sub-menu items based on the condition if the user was logged in or not.
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.