Forums

[resolved] Highlight parent when sub page is not part of the menu (3 posts)

  1. cokeyblokey
    Member
    Posted 5 months ago #

    Hello there,

    I currently have a page that is not part of my menu system. The page has a parent page, in that it's a sub of a page that's in the menu. I would like to have the parent page item highlighted in the menu when the sub page is being viewed.

    I am currently using the following code for the current page highlight:

    #menu-main-menu li.menu-item-21.current_page_item a {color:#ed1b34!important;}

    Can anyone tell me how to achieve highlighting the parent item when the sub (excluded from the menu) is being viewed?

    Thanks in advance

  2. cokeyblokey
    Member
    Posted 5 months ago #

    Any ideas, anyone?

  3. cokeyblokey
    Member
    Posted 5 months ago #

    OK, found the answer thanks to this article: http://www.designisphilosophy.com/tutorials/highlight-current-page-or-category/

    #menu-main-menu li.menu-item-21.current_page_item a,.current-menu-item a,.current-page-ancestor a {color:#ed1b34!important;}

    Hope this can help someone in the future

Reply

You must log in to post.

About this Topic