• hi all,

    would appreciate some help getting the menus on a new site working. I know what I want to do, I know the CSS to use, and I think I know which php tags to use, but my php skills are not good enough yet to actually get it working ??

    basically I’ve got a site (norwegian only) with a top menu and a submenu. I have got the dynamic hightlighting working for the top menu using the dynamic menu highligthing tutorial from the Codex, but now I want this for the submenus too.

    In short, I want the page to work the exact same way as www.remarpro.com is: if you press “about” then “about” and “intro” on the sidebar is highlighted, if you press “requirements” on the sidebar that (and still “about”) is highlighted etc.

    So, first problem: I want to just extract the subpages to a parent pages when on that parent page, this can be done using
    <?php wp_list_pages('child_of=X') ?> – but what i need to do is a loop (?) that says when on page 5 extract only subpages to 5, when on 6 only subpages to 6 etc – this is probably very trivial, but also where my lack of php skills prevents me to get it working!

    second problem: get the highlighting to work on this. I guess it should be something like: “when on a subpage to X, highlight X *and* the actual subpage”. anyone know the right approach?

    (another thing: the Codex says that if you use <?php wp_list_pages('title_li='); ?> the links will not get no heading and not be wrapped in UL and LI tags – it doesn’t get any heading, but still wrapped in LIs… this isn’t exactly a problem, but strange.)

    ..and of course: my ways of thinking might not be that smart after all, if anyone has a different approach to getting menu and submenu highligthing work (as on www.remarpro.com) please tell! I’ve been googling, searching the forums and the codex but nothing has come up.

    ok, enough so far ?? BTW, I just starting experimenting with WP for these kinds of projects after two years with Movable Type, and am mighty impressed!

    all help appreciated! cheers,
    Vegard

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter vegard

    (@vegard)

    I’m probably talking to myself here, but I found it out at last, so this is for the archives:

    first, I found another thread on the subject here in the forums, and went for Beels solution rather than the solution given in the codex tutorial. This to minimize code.

    first problem: to just extract subpages of a page when on that page, use conditional tags. I used a tweaked version of the example with the variable sidebar content here.

    second problem of giving the subpages a class was too easy. after two days of trying to figure this out, I found out (by accident) that WP is actually giving the current subpage a unique class (current_page_item) by default when using wp_list_pages. doh.

    found a plugin of interest w/r/t dynamic menu’s includes highlighting, multiple levels.. or not….
    https://www.adsworth.info/wp-pagesnav

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dynamic menu *and* submenu highligthing’ is closed to new replies.