Top

The Easiest Way to Get Custom Post Type Archives for WordPress 3.0

September 6, 2010

Custom post type archives are not automatically built into WordPress, so it’s something you’ll need to add if you plan to display an archive. A month ago we provided a guide for simulating custom post type archives for your WordPress theme through a process of creating a custom page template and calling the post type on that page.

Now there’s an even easier way to show custom post type archives on your WordPress site: Use a plugin!

Custom Post Type Archives Plugin

Custom Post Type Archives is the plugin with the most features for creating archives for your custom posts. It allows for customization from the WordPress dashboard for permalink structure, title, what templates to include and what post types will have archives.

After installing Custom Post Type Archives, you’ll be able to do the following:

  • specify a URL base for custom post archives
  • specify which template to include for which custom post type
  • specify how titles appear for custom post type archives
  • select which custom post types will have archives enabled

Without the plugin, the way WordPress naturally outputs the URL would look something like this:

http://yourblog.com/?post_type=recipes

With the plugin installed you’ll get a prettier URL:

http://yourblog.com/recipes/

The post type can now become a more natural part of your menu. You’ll be able to assign any custom template to your post type archives or a fallback template in case you haven’t created any custom templates.

Extra Functions For Theme Developers:

If you’re a theme developer, then you’ll be glad to know that this plugin also provides you with two highly useful functions:

  • is_post_type_archive – Similar to is_category or is_single, it will return true if this page is a custom post type archive or false if it isn’t.
  • get_the_post_type_permalink / the_post_type_permalink – This is used to return or echo the permalink for the post type.

RSS feeds for your new custom post type archives are available if you add /feed/ to the end of the archive URL.

Those are a few highlights of the Custom Post Type Archives plugin. It’s the best option for easily customizing your archive URL’s and selecting templates for each. More information can be found at the plugin’s homepage – http://ratvars.com/custom-post-type-archives/

Tweet This Post

Because this plugin/widget is provided free of charge, I simply ask you to link back to Pressography.com in a post on your blog, or from one of your sites. It doesn't need to be anything fancy - just a note saying that you're using it, and whether or not you like it. However, there is no requirement that you do this, you're free to use the plugin regardless.

Comments

Got something to say?

Bottom
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.