Forums

Anchor to div on category page in menu (1 post)

  1. hrose
    Member
    Posted 10 months ago #

    I'm putting a list of categories on my site as one of the menus, but I'd like to link to the content div on the category page. The only way I can work out of doing this is to use a custom link instead of the category links and using /sitename/category/categoryname#content.

    The problem is that I am using CSS class .current-menu-item to style the menu items to highlight when you're on the category page and I'm using .current-post-ancestor so that the category name highlights when visiting a post in that category.

    If I use custom links to generate the menu, I can't find a way of highlighting the menu item for the current category page and posts in that category.

    If I use the categories list to generate the menu, I can't find a way of linking to the div.

    Anyone have any advice on how to do both of these at the same time?

    Sorry if this is very basic, but I just can't work it out!

Reply

You must log in to post.

About this Topic