Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Please define "primary navigation". Also: are you using a custom theme, or one from the theme repository? –  ZaMoose Mar 12 '11 at 18:48

3 Answers 3

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.

share|improve this answer
    
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 May 18 '11 at 10:22

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.

share|improve this answer
    
My 'primary' menu is a natively created wordpress menu, zamoose. and since its automated, I can't add a link manually correct? –  Amit Erandole Mar 13 '11 at 1:38

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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