• amatsu

    (@amatsu)


    Hello. I’d like to highlight an item on the wordpress navigation menu (these are all pages) based on the current post. For instance, I have 5 pages in the nav menu which are 5 people (authors), what I want to do is that when you open a post, if it’s written by author #1, then keep the menu #1 highlighted. I don’t have any clue as how to do this, all the other information regarding highlighting is for current pages or post categories, which do not interest me.

    If it can’t be done by author ID, any other way is fine, like adding a custom field to each post maybe?

    Well, thanks anyway, I’d really like to get this done since our blog is almost finished.

Viewing 6 replies - 1 through 6 (of 6 total)
  • baszer

    (@baszer)

    hi,

    this will solve your problem

    Thread Starter amatsu

    (@amatsu)

    That doesn’t really help me, I know how to highlight pages, but what I want to do is hightlight a page from the nav menu when you are viewing a post.

    baszer

    (@baszer)

    what your URL?

    Thread Starter amatsu

    (@amatsu)

    I don’t have it online, I work in localhost at the moment.

    baszer

    (@baszer)

    it should work with the codex page is gave you.

    but you should work with classes
    something like below should work:

    .nav-authors li.current_page_item a{}

    AmeoCrisp

    (@ameocrisp)

    Have you resolve this, could you share? I have the same problem.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Highlight menu item based on current post.’ is closed to new replies.