1

For Wordpress, when creating a page, a menu entry will be added to top level menu automatically. I have disabled this feature because it is not what I what.

What I want is, like Drupal, when creating a page, I can have a dropdown select to select which menu to add this page to and to which parent.

Which plugin can do that?

Thank you.

1 Answer 1

2

You can do it yourself. What you need to do is:

  1. Use add_meta_box to add a meta box to your post editor. In that meta box, build a list of available menus using results from get_registered_nav_menus() function.
  2. Add a hook to save_post action, which will create a menu item.
  3. Create a menu item by calling wp_save_nav_menu_items($menu_id, $item_data)

It is not a piece of cake, but you can do it in a couple of hours.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for your help. Unfortunately, I am unable to do that since I do not have shell access. I can only customize through web interface (ie: custom css, etc). Is there a plugin that can do that? I can ask our IT dept to install the plugin, if they are okay with. :)
I bet there are no plugins to do that. If you don't have FTP/shell access, you can use WordPress builtin theme editor at admin - appearance - edit
Hi Karevn. Thank you. Could you please give more hints on how to do that? I am new to Wordpress from Drupal.
I can't explain in short. You need to read about wordpress actions, filters, in WordPress Codex, and then add some specific hooks. The best thing I am using for documentation is WP code usually - codex sucks when it comes to small particularities in using API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.