When I created the navigation menu at the top of my site using the menu feature in WordPress (Appearance → Menus), I didn’t want to have to maintain anything but the top-level menu items. When I released a new plugin and created a page for it, I didn’t want to have to go into my menu UI and add it there too. So instead I wrote this plugin.
Add Descendants As Submenu Items adds a checkbox to each menu item that is of a hierarchical post type (i.e. pages) or taxonomy (i.e. categories). Checking this box will automatically display all descendants as submenu items on the front end of your site. You can see it in action at the top of my site — I only configured the top level menu items and everything that shows up when you hover over them has been added by my plugin rather than manually by me.
- Download from WordPress.org (0 downloads)
Pingback: New Plugin: Add Descendants As Submenu Items « Viper007Bond.com
Pingback: WordPress Plugin Releases for 9/8 « Weblog Tools Collection
Just what I’ve been waiting for; it never made sense to me that this wasn’t standard. Thanks
Ditto, still so true to this day, many moons later : )
Got the plugin installed and running; works great, but it would be nice if it worked with categories also. 🙂
Oh right, categories can be hierarchical. Good thinking — I’ll get right on it. 🙂
Love the update, thanks again.
Pingback: WordPress Plugin ?? 09/08 | AD Nian
Pingback: Translating WordPress Plugin Details « Viper007Bond.com
I have a feature request in trac for this, but since you’ve got a plugin, I closed it. Thanks!
No reason to close the Trac ticket — it might be something useful for core. 🙂
Works like a CHAMP! Nice Plugin and saves a LOT of time!
This is exactly what I’ve been wishing for! Thanks for saving me so much time on new projects!
Pingback: WordPress Plugin ?? 09/08 | My Blog
Great plugin. Would it be possible to automatically add pages based on their categories though?
So when you create a page/post with a category it gets added to that category of the menu?
I’ve posted this on the plugin page on wordpress.org as well.
this is exactly what I want but it is not working! I have already made a menu (painstakingly taking forever!) but I still have tons and tons of categories to add and arrange hierarchy….any idea why it is not working for me?
Never Mind….It turns out your plugin is exactly what I have been looking for, if only I had found it 2 hours earlier!!!
I was in plugin trial mode, and tried this plugin that I thought was going to generate tags based on my categories…but instead it erased my categories and made them tags, when I reversed it the categories did not retain their parent/child relationship, so now I have to go back and redo the parent child relationship for 300 categories….fdsjklsdfjklsdfjkl!!!!!!!!1
Love it! Using it on a large site I am converting from Joomla to WP. This simple plugin, along with the Widget Logic plugin, allow me to do everything the Joomla CMS did and more, as far as menu management, and gets around some severe menu size limitations in WP custom menus (supposed to be fixed in WP 3.3).
With so many using All-in-One SEO pack, it would be nice to have an option on each menu item to specify “Use All-in-One Menu Tags” (if AIO is installed and activated), which would get the AIO menu label and title attributes for the top level post and its child items, and use those in the generated menu items.
I have never once used All-in-One SEO Pack and don’t really have any plans to add support for it at this time. I think the plugin is highly overrated and not needed. But that’s a discussion for another day…
Anyway, my plugin hooks in and adds the dynamic menu items so that they appear to WordPress that they’ve been there the entire time. If All-in-One SEO Pack wants to hook into the menu and add stuff to it, then it shouldn’t have any problems adding stuff to the menu items that my plugin adds either because they should all be the same in the eyes of All-in-One SEO Pack. I’m adding real menu items rather than just some HTML.
can i change the size of the submenus?
What size are you referring to? How it looks it controlled by your theme though.
Hi, I cannot get this plugin to work. I have installed the plugin, activated it, checked the checkbox (screen shot here: http://www.alexanderb.org/screenshot1.jpg )
I have created as you can see by the screenshot, a secondary menu which is what I want to be updated. I also have some php code on the page template to determine which menu to show using:
But I guess thats all on the page side, not where this plugin is getting its information from?
I of course have the correct parent attributes set on each page.
I am using wordpress 3.2.1
Any help would be greatly appreciated!
Just to clear this up, it does work, it just doesn’t show up in the Appearance > Menus panel… I was expecting it to show all the pages within the editabel list rather than simply ticking the plugin checkbox and trusting that it works! Doh! Great plugin!!
Yeah, it only takes effect on the front end otherwise it wouldn’t work. They’d all load in, you’d hit save, and then you’d lose the purpose of this plugin because they’d all be hard-coded rather than being loaded dynamically.
Thanks, this plugin is great. Only question is, how can I make sure the submenu is displayed vertically in stead of horizontally under the menu?
It’s all dependent on your theme’s CSS.
I get this error when ever I try to use your plugin
bytes exhausted (tried to allocate 45615449 bytes) in /home/content/w/e/b/webjazz/html/test/wp-content/themes/Jazzschool_Theme/library/navigation.php on line 329
The plugin doesn’t seem to work with categories as I would expect. In short, I am hoping to have all posts for a specific category automatically show up in a submenu beneath the category menu item. Instead, here’s what I’m experiencing…
I have four categories for posts, for each of which I have created a menu item in [Appearance>Menus]. For each of the category menus, I have selected to ‘Automatically add all descendents as submenu items.’ The behavior that I expect is that each of the category submenus will automatically display a submenu listing all of the posts for that category. But that’s not happening. Is there any way to use your plugin to achieve the behavior that I’m seeking? Thanks!
No, my plugin is trying to list out children categories for each of the categories in your menu. It won’t list out posts for a category.
My plugin won’t do what you want, although you could use the concepts used in my plugin’s code to write code of your own to do what you’re looking for.
WOW, it works great for me.
Exactly what I was searching for.
Thanks a lot!!!
Hi there – love your plugin but yet I’m selfishly trying to make it do one more thing. My client is making month categories and we’d love to be able to order them in chronological month order, as opposed to alphabetically or when the category was added or whatever. I’ve tried one plugin to let me order categories but it doesn’t seem to work while using yours. Any possibility this can be done? Before I go blindly using trial and error to find another ordering plugin that’d work. (Actually, if you do know of a category/subcategory ordering plugin that’d work with yours, I’d love to know which one.)
Categories don’t really support ordering in general so yes, you’d need a plugin. How to make that interact with my plugin? No idea without seeing the other plugin. 🙂
Hi, im trying to make it work with Ubermenu without success!!!
With Ubermwnu plugin (this plugin work with the wordpress custom menus)
I haven’t looked at that plugin’s code but it likely implements it’s own menu code. My plugin is written for the menu code that is built into WordPress.
It works great ! Thanks
Can you please add support to display the empty sub categories in the menu as its not showing the sub-categories that have not assigned any post to them.
Why would you want to link to a page that would just display an error message? 🙂
It could be used to add custom post types items created with MagicFields?
It would a good point to have the option to set a custom post type to be showed as descendant of a menu item.
Ie: A page called “services” added in the main menu, and an option to assign a custom type called “Services” to be auto added as descendant items in the Services Main Menu Item.
It supports custom post types but it does not support cross-types, only showing descendants.
Hi Alex, I am using your plugin on the wordpress template ” I Love it! ” and it looks like the plugin works but it is not showing the link to the categories :s
Could you pls help me out 🙂 tnx
Try temporarily switching to a different theme, such as Twenty Eleven. If it works fine there, then you know it’s an issue with the theme and not my plugin. 🙂
Just tried the plugin and it works great on all of my pages except for my home page. The sub-menu shows up when I hover over the top level menu (although the styling isn’t quite right), but as soon as I try to move the mouse off the top level menu and onto a sub menu item the sub menu disappears.
Any help is much appreciated, thanks.
I’ve done a little bit more looking snooping around in the HTML, and it looks like when the menu is working properly, the class ‘sf-menu’ is on the ul and the class ‘sf-with-ul’ is properly on the a tag used for the menu item. But when i’m on the home page (which is a static page) the ul still has the class ‘sf-menu’, but the a tag does not have the class ‘sf-with-ul’
Any ideas what could be causing this?
Pingback: INIA | Design | JulioSepia.com
Great plugin 😉 But is it somehow possible to order the submenu in the order that I decide instead of alphabetical?
For pages, yes. For everything else, no.
For pages, it goes off menu order and then secondarily title.
How is that connected to the add descendants as submenu items plugin?
My plugin sorts the pages it adds to any menu by that value first, and then secondarily by title.
Searched for this plugin for several hours. And finally google helped me to your site. Thanks a ton. I really wished that I could pay you by some click on ads if they appeared on this site. A word of thanks is all that I can offer now. There is a similar plugin called gecka submenu and its features are similar to yours except that you offer taxonomies also for free while they charge for that feature under pro version. Millions of thanks to you once again for being helpful to small site owners like me.
It doesn’t work for me… Am I doing something wrong?
I installed your plugin and then added all categories I had to the Menu, checking all the “Automatically add all descendants as submenu items” boxes while I did that. But the menu just won’t behave properly… It won’t show any child categories, old or newly created…
I even tried with a few different themes, but to no avail. (on WordPress 3.4.2)
@Fernando In my view, there could be two reasons why I the child cats are not showing up for you.
One, you may not have assigned any posts to the categories. If your child category has zero posts, it won’t show up in the menu at all. Try to assign atleast one post to a category and check.
The second reason could be the way your navigation menu is setup. If you are using wp_nav_menu() then there is a parameter called ‘depth’ which should be assigned to some value. If depth=1 then only one level will be shown. You may find this function in the header.php if your menu is in the header. More about this wp_nav_menu can be found at http://codex.wordpress.org/Function_Reference/wp_nav_menu
Alex, your plugin saved the day. Thanks a million!
First off, awesome plugin! It saved my site from the annoying menu crashes when you have many menu items (50+).
One feature request, would it be possible to have the option to only include child pages that are 1 step below the parent, i.e. to not include the children’s children? This is because in some places I have these grandchildren pages, but don’t want them to show up in the menu (they are accesable from hyperlinks on the child page). I’m sure I can’t be the only one who would want this.
I tried doing it myself by editing the plugin, but unfortunately my coding experience with WordPress is not high enough.
Hi alex. i am using your plugin but not working my template.What can I do ?
Pingback: Happy New Year And Welcome To 2012 | Clandestine Laboratories
hi pro, how to use this plugin?
sorry, i’m wp newbiew 😀
please make video tut if you have a free times 🙁
i tried all the way but not seccessful:(
Hmm, is there any way to make the plugin only add a certain depth of descendants? I tried of course “depth=1”, but all levels still were imported. It would be handy either way to have this option on a per item basis…
In other words, after the “Automatically add all descendants as submenu items” check box, it would be great to have a “Depth of descendants” option.
+1 for this feature! I mentioned it in an above comment on December 19th. A depth setting would be so useful.
Love your ADASI plugin and I’ve translated ALL of its strings into Arabic 😀
Would love to contribute my work, let me know if you accept translations and if so where to send you the .po/.mo files.
Replied to your e-mail. 🙂
I’m a noob WordPress programmer, but I found a way to make it so only the child pages are included and not grandchildren. See http://wordpress.org/support/topic/get_pages-how-to-disable-grandchildren?replies=6 for the code. Just replace the get_pages part in the add_children_to_menu function in the plugin’s php file.
Pingback: Changes Over The Last 3 Months | Clandestine Laboratories
Thanks for this plugin, Alex! I literally stumbled upon it. You could add to your post so that it can be found by searching for it for another solution it provides: **hiding empty categories** from big, pre-built nav menu structures until the categories are used.
There was still looking to create a submenu and fortunately I found you.
Thanks for the plugin.
I’ve installed this on two sites…works great on first one…I agree with everyone else…can’t believe this is not a standard option…anyway, on the other site I am not seeing the check box in the menus that I need to check to activate the plugin…it’s not there for pages, cats or custom taxonomy…any idea what would cause this?
and of course now it is there despite not being there through 3 attempts. All good. Thanks!
Great plugin! The only thing I’m missing (as some others before) is the possibility to set a maximum depth for the displayed sub-menues. So +1 for this feature
I’ve run into a powerful problem with this plugin: it’s rearranged the world!
I use this on a site with posts categorized by national hierarchies (eg. North America > USA > Texas).
Each of the ‘continents’ represent the highest level of menu item, cascading to the nation & region/state.
However, not all of the subcategories (countries) end up under their parent categories (continents), or states/provinces in the correct country:
For instance: Australia is placed under Italy when they are peer subcategories under different parent categories. Western Cape (Africa/South Africa/Western Cape) is placed under South America.
I’ve put up screencaps of the menu structure and the category structures for these examples. Links are on the plugin support page at WordPress.org
Can you advise or help out? Problem determination?
Love the plugin, it makes it possible for me to add more menu items, because this was limited.
One question however:
How do I change the navigation labels of the children and grandchildren?
The labels are controlled by the page (or category) name, so rename the page/category if you want to rename the menu entry. There’s no ability to have them be different — use manually created menu entries if you want to do that.
Hi Alex, I’m using your plugin for the display of categories as menu items when the categories have associated posts. Works OK-ish, except some menu items are not appearing in the right places. See the site here: http://architourist.ca/
The actual hierarchical category structure (continents, nations, provinces, etc.) can be seen in the ‘destination’ section in the sidebar: Australia is in Oceania, Western Cape is in South Africa.
The blue nav menu is built with the ADASI plugin, but this puts Australia in Italy and Western Cape in South America.
Can you help with some ideas about how this might be corrected? I have previously deactivated and deleted the plugin to try to correct it, but reinstallation brings back the problem. I have a mirror of this site available for you to login and review, test, whatever if you like.