I now switched to permalinks and defined my own structure
/%postname%. If I click on a menu item it takes the path from the parent page (hierarchy defined directly when editing a page).

What I want is for the permalink to use the structure of the menu.

How can this be done?

3 Answers
3

Yes, I could set the menu structure, but I don’t know if the user would make this, when he creates a new page. The difference is here because I needed the hierarchy for some special adaptions I made (read the content from certain sub pages and so on …). Normally, the menu should define the structure of the permalink. That’s the reason why I asked for it. And the menu hierarchy is already available. So one would have to define the hierarchy two times. Perhaps I don’t understand a certain concept.

The “menu” doesn’t define anything in any web application. At least not if the architecture isn’t bogus and assumes that everyone actually got a menu. There’re other navigation ideas as well.

To get data from the siblings of a page, you can use get_page_children() – detailed use case in Codex. That function will work for hierarchical post types as well.

Leave a Reply

Your email address will not be published. Required fields are marked *