• Hello all,

    I’m developing a quite simple theme. Now I’m having trouble with the menu. Since there are a few ‘hardcoded’ menu items (since it all is dropdown) but the content of these dropdowns are dynamic… I am wondering how to get the toplevel item when a page is clicked.

    For example: In category’s I have News and Fun, if I click News OR Fun I want to retrieve that the page is in category’s. Same for pages, I would have “About me” and “Portfolio”…if I click either of those I want to retrieve the toplevel (pages)…

    How does this work in WP?

    Thanks in advance!

The topic ‘[PHP] Get toplevel menuitem from current page’ is closed to new replies.