WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Keeping twenty ten menu expanded (5 posts)

  1. LachlanF
    Member
    Posted 3 years ago #

    Hey guys,

    So I've built a site using a modified version of the twenty ten theme, and I've primarily kept it for the ease of the navigation menu. I've set up the site so the top level of the menu goes to various pages and the submenu items go to in page anchors within each section. When you're in a given page the top level menu item is a different color, which was easy enough, but I'm also wondering if I can keep the submenu for the page being visited constantly open for ease of navigation? I haven't worked it out yet, but I'm guessing there is a way...

    Cheers, Lachlan

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    You'd have to edit the theme's stylesheet and rewrite the CSS for the .current-page-item children.

  3. LachlanF
    Member
    Posted 3 years ago #

    Yeah seems fair. Which one of these two style blocks needs editing?

    #access ul li.current_page_item > a,
    #access ul li.current-menu-ancestor > a,
    #access ul li.current-menu-item > a,
    #access ul li.current-menu-parent > a {
    color: #000;
    background:#FFF;
    }
    * html #access ul li.current_page_item a,
    * html #access ul li.current-menu-ancestor a,
    * html #access ul li.current-menu-item a,
    * html #access ul li.current-menu-parent a,
    * html #access ul li a:hover {
    color:#000;
    background:#FFF;
    }

    And what do I need to add? I tried putting in display:block with no success...

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    You don't want to edit CSS - you want to add it. Specifically you need to overwrite display:none; for #access ul ul. Off the top of my head, something like:

    #access ul .current_page_item > ul {display:block;}

    might work.

  5. LachlanF
    Member
    Posted 3 years ago #

    Cheers mate, had to modify it slightly to whats below, but then it worked like a treat!

    #access ul li.current_page_item > ul {display:block;}

Topic Closed

This topic has been closed to new replies.

About this Topic