WordPress.org

Ready to get started?Download WordPress

Forums

highlight page in menu, if article from the same category is shown (2 posts)

  1. wpgsus
    Member
    Posted 3 years ago #

    I have rather strange question, and I'm not really good with wp template syntax. But I really hope to get some help from wp community.

    I have a custom theme for wp. My menu is shown by the wp_list_pages function. And I have another menu which is shown in some pages.

    It shows articles from the same category as the active page is. When I open one of thoose articles, I loose highlighting from the page which is in the same category as the article and which is shown in the top menu.

    How can cope with this problem and make wp to highlight page in the menu, when the article from the same cat is shown?

  2. Alx
    Member
    Posted 3 years ago #

    I'm not 100% sure that this will work.

    The change that you need to make is in your css file (most likely style.css) and what you want to look for is:

    .current_page_item { … }

    and then you want to add in these styled the same way, with the style elements where the … is below:

    .current_page_parent { … }
    .current_page_ancestor { … }

    That should work it out. A link to your site would help to really let you know, though.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.