Easily Add Custom Post Types To WordPress

tutuploadsStep_1_-_Install_the_Plugin.png

WordPress continues to improve on its ability to mange content. Custom post types and taxonomies are a big step in making WordPress a fully featured CMS.

If you’re not sure what custom post types are, go ahead and read this tutorial first.

Custom post types are powerful tools for creating an information architecture. However, by default you are required to write code if you want to use them.

Fortunately, there are a number of plugins that allow you to create post types and taxonomies to go with them. This tutorial explains the use of Custom Post Type UI.

Step 1: Install the Custom Post Type UI Plugin

tutuploadsStep_1_-_Install_the_Plugin.png

First Click “Add New” in the Plugins section of the administrative menu, so you can go to the plugin search. Or if you prefer manual installation, download the plugin

tutuploadsmedia_1314589312831.png

Search for : Custom Post Type UI and use the install function to install and activate it.

After installation you will have a new section on your administrator menu for Custom Post Types:

tutuploadsAfter_installation_you_will_have_a_new_section_on_your_ad.png

To start creating Custom Post Types, click Add New.

Step 2: Create a custom post type

tutuploadsStep_2_-_From_the_plugin_page__create_a_custom_post_type..png

The first thing you see will be the entry form for creating a custom post type. Filling out this will quickly create a post type. There are Advanced Label Options and Advanced Options as well. You can expand the form by clicking the these to open it up. For now just give it a Post Type Name, Label and a Singular Label.

The advanced option defaults are set to work for most uses. You might want to get familiar with using custom post types and taxonomies before you adjust them.

Samples of what you should enter are shown to the right of the boxes (e.g. movies)

In Post Type Name, don’t use any capitals or spaces. This name will not show on the website and is used in your data base. So don’t add anything that might break a link. Keep it short. Use dashes or underscores if you absolutely have to. Be careful you don’t use words that may be used by other plugins. For instance “products” may be used by a shopping plugin, so name your field xyz_products or something unique.

Mouse over the question marks for tool tips.

The description is optional.

Click Create Custom Post Type to create, and you will see your creation added to the administration menu in the form of a new section.

Step 3: Create a taxonomy for your custom post types

tutuploadsStep_3_-_Create_a_taxonomy_for_your_custom_post_types__an.png

The form for creating the taxonomy is on the same page you used for creating the post type.

“Taxonomy” creates labels for additional data that will go along with with your custom post. In the case of creating a movie data base, you might want to also list the actors, director, genre, release year or other information. Create a label for each item you want and then click “Create Custom Taxonomy”.

Choose what you want these taxonomies to be attached to. If you choose all the boxes you will see choices under Posts, Pages, Movies for actors. (Books is a custom post type which I added, you won’t have that choice by default.

If, as in the example, you are doing a movie data base, you probably only want to check the Movies box. If you choose them all your menu will look similar to the one below. Most likely you will only need them attached to one type.

tutuploadsmedia_1314591000049.png

Movies and Books have been added to the dashboard as custom post types. You can see additional links under movies for Actors, Directors and Writers. These were added when I created the Taxonomy for movies. You do this on the right side of the plugin’s administration page.

tutuploadsmedia_1314591666533.png

If you choose all the boxes, under “Attach to Post Type” your taxonomy links will appear under posts, pages and any other post types you chose.Think about what you want to call these. For instance if you are doing both books and movies, you may want authors and main characters for books, or writers and actors for movies. You probably don’t want all post and pages to have the same taxonomy.

Step 4: Add content to your custom post type

tutuploadsStep_4_-_Add_content_to_your_custom_post_type.png

Click Add under the section you created for your new custom post type. In this case it’s under Movies. Fill in the editing boxes like you would for any post.

Step 5: Classify your post using the taxonomy you created.

tutuploadsStep_5_-_Help_classify_your_post_using_the_taxonomy_you_c.png

On the right half of the page, you will see entry boxes for your taxonomy items. In this case you see Actors, Directors and Writers. You can type in their names separated by a comma, and those names will be attached to the data for this entry. These are similar to tags, which is another taxonomy that can be included by customizing the post type using the Advanced Options.

Step 6 – Add Existing Taxonomies

tutuploadsStep_6_-_Add_Existing_Taxonomies.png

You already have existing taxonomies that come with WordPress. For example Categories and Tags are taxonomies. You can add them by expanding Advanced Options and clicking the check boxes as needed.

If you want to use custom fields or other default features supported click the check boxes under Supports. If they are checked, you will have these options on the editing page. Unchecked and they do not show.

Author

0 0 votes
Article Rating
Subscribe
Notify of
2 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Gavman
12 years ago

This seems to have lots of potential but I am still not clear how the viewer sees these taxonomies. Using the example above, does the viewer see separate tag clouds for actors, directors and writers? or if we use the built in taxonomy which includes tag clouds, do the custom posts get integrated with tags for normal posts? if the latter, this would render the database for custom posts much less effective

Nick
12 years ago
Reply to  Gavman

Resolved in the support forum the same day 🙂

Kind regards,

Nick

2
0
Would love your thoughts, please comment.x
()
x