Jump to content
hugo2808

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

Recommended Posts

hugo2808    1
hugo2808

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
James B    436
James B

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?


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
hugo2808    1
hugo2808

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
James B    436
James B

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.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
hugo2808    1
hugo2808

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
Rob    547
Rob

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.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×