WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
Costum content type pages in nav menu? (5 posts)

  1. bhenselmann
    Member
    Posted 2 years ago #

    How could I include custom content type pages in the main nav menu? Thanks for assistance!

  2. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    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".

  3. bhenselmann
    Member
    Posted 2 years ago #

    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?

  4. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  5. bhenselmann
    Member
    Posted 2 years ago #

    thanks a lot for this long answer!! understanding the problem better now. I´ll give sumarize-posts-plugin a try.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic