• Thank you for your timely help.

    I have a WordPress menu, where I need the parent item to remain Active when the Child menu items (or pages) are active.

    I can’t figure out how to make it work.

    Please can someone explain the CSS i need.

    I read this, but it’s not helping:
    https://css-tricks.com/forums/topic/keep-parent-item-active-when-child-element-is-current-page-csswordpress/

    Here is my HTML
    *******
    <li id=”menu-item-67″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-67″><span>CLIENTS</span>
    <ul class=”sub-menu” style=”float: none; width: 12em; display: none;”>
    <li id=”menu-item-20″ class=”menu-item menu-item-type-post_type menu-item-object-page menu-item-20″ style=”float: left; width: 100%; white-space: normal;”><span>The List</span>
    <li id=”menu-item-19″ class=”menu-item menu-item-type-post_type menu-item-object-page menu-item-19″ style=”float: left; width: 100%; white-space: normal;”><span>What They Say</span>

    ********

    There are one parent menu “CLIENT”.
    And two children “The List” and “What they say”.

    When the children pages are selected, I need “CLIENT ” to by styled “color:red”

    Thanks for showing me how to do this.

    If it helps, I’m using this theme:
    https://dreamthemedesign.com/themes/u-design/portfolio/one-column-portfolio/
    (notice when a child is selected, the parent is NOT style orange…I need that!)

    Thanks!

    J.

Viewing 1 replies (of 1 total)
  • The CSS classes that you need to target are

    current-menu-parent and current-menu-ancestor

    Those classes are added to menu items that are parents and ancestors of the current menu item.

    As for how todo it, you should ask the themes author/vendor. As it’s a commercial product, you’ve paid for their support, and we don’t have access to their code bse.

Viewing 1 replies (of 1 total)
  • The topic ‘Keep Parent Item Active when Child Element is Current Page – CSS/WordPress’ is closed to new replies.