Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #687274

    Hello Enfold Team,

    I have a question concerning the main menu:
    I would like to make the menu item active when clicking into a product.
    (I have a general page in my Menu “Work Pants” I would like to keep “Work Pants” highlighted when I click on one of my products).

    I tried this CSS but it doesn’t work:
    #avia-menu .active-parent-item { overflow: visible !important; }
    and
    .html_header_sidebar #header .av-main-nav .active-parent-item { overflow: visible !important; }

    Could you help me with that.

    Thanks again for your help.

    Kind regards

    Bibahbuh

    #687925

    Hey bibahbuh,

    Could you post a link to the site in question so that we can take a closer look please?

    Thanks,
    Rikard

    #688030

    Hey Rikard,

    Thanks for your reply.
    Please find the link to the website in the private data.

    Thanks.

    Kind regards,
    Bibahbuh

    #688074

    Hi,

    We added the below code to functions.php please review the site and let us know if you have any questions.

    // highlight work menu
    
    function highlight_menu(){
    ?>
    <script>
    jQuery(window).load(function(){ 
    	if (jQuery('body').hasClass('single-portfolio')) {
          jQuery('.main_menu').find('#menu-item-455').addClass('current-menu-item');
    }
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'highlight_menu');

    Best regards,
    Vinay

    #688080

    Hello Vinay,

    Thanks a lot!! It’s working great!
    Have a nice day.

    Kind regards.
    Bibahbuh

    #688082

    Hello again,

    I have another question concerning the highlight menu:
    If I want the same when I’m in another tab, like accessories page. Do I have to change something in the Theme Function.php?

    And also, is it possible to have in my accessories product with this url: /accessories/henning/ instead of /work-pants/henning/
    (I changed it via Settings/permalink/Portfolio Items Base –> Work Pants)

    But as you can see in my website I have two tab: work pants and accessories. (I distributed my portfolio items into 2 tabs: Work Pants and Accessories)

    Thanks a lot again for your help.

    Kind regards.
    Bibahbuh

    #688109

    Hi,

    You are welcome :) WordPress adds a class called “single-portfolio” to the bod tag which we can use in jQuery to check if body tag has a class that we want and highlight the work pants menu.

    If you add a portfolio item in accessories that will also highlight work pants because wordpress will always only add “single-portfolio” to body tag and it cannot be differentiated hence can be used only on one menu item.

    To change the permalinks please check https://codex.wordpress.org/Settings_Permalinks_Screen

    Best regards,
    Vinay

    • This reply was modified 8 years, 3 months ago by Vinay.
    #688304

    Hello Vinay,

    Thanks for your reply :)
    What I did and works great:

    I add a wordpress plugin: Custom Permalinks.
    With this plugin I was able to change my portfolio items url: /work-pants/henning by /accessories/henning (because this item “henning” is located in an other page call Accessories and not Work Pants)

    Then, I add a wordpress plugin : Yoast SEO for the 301 redirection to an old to a new url (if I understood well) by modifying the .htaccess file.

    Everything is working great, for now. (the website is not yet live.)
    Hope I did well.

    Thanks again.

    Kind regards.
    Bibahbuh

    #688947

    Hi,

    Great, glad you got it working and thanks for the feedback :-)

    Please let us know if you should need any further help on the topic.

    Regards,
    Rikard

    #689095

    Hi Rikard,

    Thanks for your reply.
    All good for me now :)

    Thanks for your help, great support!

    Kind regards.
    Bibahbuh

    #689537

    Hi,

    Glad we could help! We really appreciate it if you rate our theme on themeforest.
    To know more about enfold features please check – http://kriesi.at/documentation/enfold/
    Please feel free to reach out to us if you need any help in future via new ticket we are happy to help!
    Thank you for using Enfold :)

    Best regards,
    Vinay

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘How to keep a main menu tab highlighted when I click on a product item?’ is closed to new replies.