Costum content type pages in nav menu?
You can go to Appearance –> Menus (like normal), and select your custom pages and click the “Add to Menu” button just like any other post or page. Just make sure that your custom content type definition is marked as “Public”.
Thanks for the fast reply, fireproofsocks. Unfortunately this is not very confortable, because I have to edit the menu each time, when I´m adding a new page of the custom content type (in my case it should be a subpage of a standard page and I´ld like to use the hierarchical menu of the theme). Is there a WP-function, with wich custom type content could be included in the nav?
So you’re not wanting a static menu (which is what I outlined), you’re wanting a *dynamic* menu that updates when you create new pages in your custom post type?
I’d recommend using my other plugin for this: http://wordpress.org/extend/plugins/summarize-posts/
WordPress does not help us out here very much, unfortunately. So what you’d end up doing is writing some code in your templates that query the custom post types. This is essentially what your theme’s index.php file does, albeit only for “posts”. So the challenge is how to emulate that same functionality for your custom post types.
The solution that I came up with was to create a *page* that will be used to house the code to summarize the posts in your custom content type (thus the name of the other plugin). The Summarize Posts plugin supports shortcodes, so you can create a normal WP page and add a shortcode to that page’s content, or since pages can use custom theme files, you can add a dedicated theme file for that page and put your PHP code in there.
Formatting a hierarchical menu is very tricky — there are LOTS of formatting options to consider. I did file a feature request for this: http://code.google.com/p/wordpress-summarize-posts/issues/detail?id=1 but it’s probably going to be difficult to sell this level of customization to the typical WP crowd. There’s the also the fact that retrieving hierarchical menus can REALLY hit the server and the database hard — it’s a similar issue that MODx and Drupal overcame in very different ways, but essentially the only “real” way to solve this type of thing in a scalable way is via some sort of caching, and as soon as caching gets involved, the complexity goes way up.
So that’s a long answer to your question… hopefully that wasn’t too much babble for you. In short, try the Summarize Posts plugin and have a go at writing your own menu-generation code.
- The topic ‘Costum content type pages in nav menu?’ is closed to new replies.