1

I have 4 custom post types set up in my blog and video is one of them. I want the video archives page (archives-video.php) to shop up in my primary navigation.

how do I do this without writing a custom function?

1
  • Please define "primary navigation". Also: are you using a custom theme, or one from the theme repository?
    – ZaMoose
    Commented Mar 12, 2011 at 18:48

3 Answers 3

1

Straight from the Wordpress documentation for registering_post_type in the code you are registering your custom post type you should be able to add: 'show_in_nav_menus' => true, and that should allow your post type to show in navigation menus. Here's the documentation for the register_post_type function

Adding a link in your menu straight to the page also works, but in my opinion it is very messy. It would seem not many people are aware of the show_in_nav_menus argument of register_post_type because by default the value is set to false.

Hope this helps you.

1
  • For me at least, adding 'show_in_nav_menus' allows individual posts to be added to the menu, but doesn't give me an addable archive page, which is I believe what the asker was looking for
    – MrCranky
    Commented May 18, 2011 at 10:22
0

In absence of further context from you, I would advise that you create a WordPress menu and simply add a link to your custom post type's archive page.

1
  • My 'primary' menu is a natively created wordpress menu, zamoose. and since its automated, I can't add a link manually correct? Commented Mar 13, 2011 at 1:38
0

Amit,

WordPress (3.2) does not currently provide a way for you to add custom post type archive page into the navigation. One way to do it would to create a page with a slug that matches the slug of your post type archive page. This page will just be a placeholder so the archive page shows up in your navigation.

For example, if, when registering your video CPT, you set has_archive => 'videos', create a page called 'Videos'.

Videos will now show up in your navigation and when /videos/ is requested, users will get the videos CPT archive page and not the Videos page because of the order of the rewrite rules that WordPress creates.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.