Archived

This topic is now archived and is closed to further replies.

  • 0

highlight a menu item if the post page displayed is from a certain category


Question

Posted · Report post

Hi all,

I would like to make something like: "highlight a menu item if the post page displayed is from a certain category"!

When I enter in a post I loose all highlights of the menu, because my posts don't reference any page.

So, if I enter in a post of Category A, can I highlight a certain menu item of my menu?

 

Thanks

 

Hugo

Share this post


Link to post
Share on other sites

5 answers to this question

Posted · Report post

Hi Hugo,

 

The only way to highlight a category when active would be to make the category the menu link as James suggests.  In that way, when you're on the category, it should remain highlighted, but any subcategory will not do that. I don't think a post within the category will keep the menu highlighted either, only being on the category page itself.

 

To customize this, you'll need either a plugin (if it exists) or, one of our Pro developers to help you write specific code to accomplish your goal.  Please see http://www.pagelines.com/pros.

Share this post


Link to post
Share on other sites

Posted · Report post

It would really depend on how you've set your menu up, is it using category links inside a custom menu?

 

If you can put up a live link to the page in question and tell us which items on the page you want to affect the menu we'll have a look into the code to see if this is possible.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi there,

 

I don't think you'll be able to do this easily.

 

The only way I can think of would involve using css based on the post id to highlight the menu item. That would mean that you would have to do this for every post you wrote, which would be very time consuming.

 

Is the menu item you're trying to highlight related to the content in anyway? Is it a link to a category page for example?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

no, I haven't set category links on the menu, only pages!

 

I'll put it online and will be back to you!

 

Thanks

 

hugo 

Share this post


Link to post
Share on other sites

Posted · Report post

Hi!

Yes, I have a menu with pages, and inside each page I have links to posts!

So would like to keep the menu item of the 'parent' page highlight when I enter the post.

Share this post


Link to post
Share on other sites