Support » Fixing WordPress » posts (homepage) current_page_item CSS class in menu, top level without A href

  • Hello,

    please, how to have the current_page_item (current_page_ancestor resp.) css class on the LI menu element corresponding to homepage (index.php) or some post (single.php)?

    I am NOT using custom (dynamic) menu and I do not want to do so, because I want to keep the menu actualized automatically on any page addition/removal in the “pages” admin menu (dynamic menus support only “Automatically add new top-level pages“)

    Here is some demo:

    BUT. There are two issues:
    1) If any top menu item has a sub-menu UL (e.g. “O NÁS” or “ZKUŠEBNÍ STRÁNKA“), then this top level item should not be clickable (without A tag) – it is just an empty dummy page just being there in order to have it in the menu.

    2) I need to get the homepage, that is default posts – news (index.php) and any particular post (single.php) being also contained in a submenu. In order to do so, I’ve created a dummy subpage (“O NÁS -> aktuálně“) which is being redirected via Speedy Page Redirect plugin onto the homepage. It works, BUT this way the CSS class current_page_ancestor is NOT present on the top level menu item, of course 🙁

    So I need somehow:
    a) achieve it (solve this issues) without having custom (dynamic) menu
    b) let the custom menu be actualized automatically according to real sub pages (set in “pages” admin menu) somehow.

    Anybody could help, please?
    Thanks a lot

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘posts (homepage) current_page_item CSS class in menu, top level without A href’ is closed to new replies.