Custom Post Types in the WordPress Navigation Menu

I took a look at Justin’s ‘writings’ menu. I don’t believe he’s using custom post types for this — I think they’re just regular posts and drop down menu is displaying category archives.

Here’s how you can replicate the same setup for custom post types.

Make sure your custom post types support a taxonomy, such as tags, categories or a custom taxonomy. Then expose the taxonomy items (categories, tags or any custom taxonomy) you need on the menu page. You do this using the screen options:

Screen Options for Menu Configuration Page

Note that my custom post types are not selected, but my custom taxonomy, ‘topics’ is selected. In my case, this taxonomy is only applied to my custom post type — and gives me the ability to replicate the same thing as Justin is doing with my custom post type.

menu config entries

The menu dropdown entries shown include an archive listing of cpt posts matching either of two taxonomy terms (type = custom) and the more typical entry, an archive matching a particular single term (type = topic).

Your theme has to support archive listings for your custom post types. Not all themes will support them out-of-the-box.

If you’re using categories or tags to do this, you need to ensure that the terms you select are only applied to your custom post type or you’ll have to customize the archive template code to filter out the other post types.

Update

If you really want a single menu item that will show all your custom post types, you can link directly to the custom post type archive, like I do here:

custom post type archive listing menu item

Here’s how to get that URL from your CPT registration code: Get custom post_type’s archive URL