This topic has 8 replies, 3 voices, and was last updated 8 years by mtgame21.

  • Author

    Tagged: ,

  • #78606
     ImG
    Participant

    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!

    #78669
     Laura
    Moderator

    Hello, 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 solution

    Laura 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 🙂

    #78754
     ImG
    Participant
    This reply has been set as private.
    #78822
     Laura
    Moderator

    Hello, 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 solution

    Laura 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 🙂

    #78904
     ImG
    Participant

    Hi @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.

    #79016
     Laura
    Moderator

    Hello, 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 CODE
    
    li#menu-item-3112 {
        display: none !important;
    }
    

    Inside the <style> </style> where the other one is
    Just change the menu item id

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura 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 🙂

    #79115
     ImG
    Participant

    Hi @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?

    #79287
     Laura
    Moderator

    Hello, 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 that

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura 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 🙂

    #79386
     mtgame21
    Participant

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

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?