0

I have a menu, but when I go to the submenu page, the parent of this submenu is not highlighted. How to do this?

When it doesn't have a submenu, it works fine:

enter image description here

My menu structure is:

<nav class="x-nav-wrap desktop" role="navigation">
  <ul id="menu-x-demo-menu" class="partial-refreshable-nav-menu partial-refreshable-nav-menu-1 x-nav">
    <li id="menu-item-224" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-224 tax-item tax-item-1"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/category/newsy/"><span>Newsy</span></a></li>
    <li id="menu-item-5" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-5"><a href="http://serwer1475046.home.pl/pstrony/vocal/"><span>O nas</span></a></li>
    <li id="menu-item-197" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-197"><a href="#"><span>Dorośli</span></a>
      <ul class="sub-menu">
        <li id="menu-item-200" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-200"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/o-szkole/"><span>O szkole</span></a></li>
        <li id="menu-item-310" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-310"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/program-ksztalcenia-dorosli-dorosli/"><span>Program kształcenia i opłaty</span></a></li>
        <li id="menu-item-202" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-202"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/rekrutacja/"><span>Rekrutacja</span></a></li>
        <li id="menu-item-199" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-199"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/kadra/"><span>Kadra</span></a></li>
        <li id="menu-item-279" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-279"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/galeria-dorosli-i-mlodziez/"><span>Galeria</span></a></li>
      </ul>
    </li>
    <li id="menu-item-208" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children menu-item-208"><a href="#"><span>Młodzież</span></a>
      <ul class="sub-menu">
        <li id="menu-item-205" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-205"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/o-szkole-mlodziez/"><span>O szkole</span></a></li>
        <li id="menu-item-206" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-81 current_page_item menu-item-206"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/program-ksztalcenia-dorosli/"><span>Program kształcenia i opłaty</span></a></li>
        <li id="menu-item-207" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-207"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/rekrutacja/"><span>Rekrutacja</span></a></li>
        <li id="menu-item-204" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-204"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/kadra/"><span>Kadra</span></a></li>
        <li id="menu-item-278" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-278"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/galeria-dorosli-i-mlodziez/"><span>Galeria</span></a></li>
      </ul>
    </li>
    <li id="menu-item-321" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-321"><a href="#"><span>Dzieci</span></a>
      <ul class="sub-menu">
        <li id="menu-item-65" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-65"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/dzieci/"><span>O szkole</span></a></li>
        <li id="menu-item-337" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-337"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/program-ksztalcenia-dzieci/"><span>Program kształcenia</span></a></li>
        <li id="menu-item-342" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-342"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/rekrutacja-dzieci/"><span>Rekrutacja</span></a></li>
        <li id="menu-item-273" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-273"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/kadra/"><span>Kadra</span></a></li>
        <li id="menu-item-343" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-343"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/galeria-dzieci/"><span>Galeria</span></a></li>
      </ul>
    </li>
    <li id="menu-item-280" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-280"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/galeria-dorosli-i-mlodziez/"><span>Galeria</span></a>
      <ul class="sub-menu">
        <li id="menu-item-263" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-263"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/galeria-dorosli-i-mlodziez/"><span>Dorośli i Młodzież</span></a></li>
        <li id="menu-item-264" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-264"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/galeria-dzieci/"><span>Dzieci</span></a></li>
      </ul>
    </li>
    <li id="menu-item-69" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-69"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/szkolenia/"><span>Seniorzy</span></a></li>
    <li id="menu-item-67" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-67"><a href="http://serwer1475046.home.pl/pstrony/vocal/index.php/kontakt/"><span>Kontakt</span></a></li>
    <li class="menu-item x-menu-item x-menu-item-search"><a href="#" class="x-btn-navbar-search"><span><i class="x-icon-search" data-x-icon="" aria-hidden="true"></i><span class="x-hidden-desktop"> Search</span></span></a></li>
  </ul>
</nav>
  • The user asking the question is not active anymore, therefore, we are unable to ask for clarification. Also, because of inactivity he or she cannot accept an answer making this open question pointless. – Remzi Cavdar Nov 2 '18 at 20:22
2

Use the classes current-menu-ancestor current-menu-parent and menu-item-has-children

| improve this answer | |
  • It looks like you're pointing him or her in the right direction, only there is no feedback, so we don't know if this did work – Remzi Cavdar Nov 2 '18 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.