One of the reasons WordPress powers 27% of the Internet is that it’s an incredibly flexible content management system. We all know about the standard Pages and Blog Posts that you can create easily with WordPress, but what about when you want something more customized and specific to your businesses’ needs? That’s where WordPress Custom Post Types and Custom Fields come in.
Let’s say you want to have book reviews on your website and for each book review, you need the name of the book, the author, the date published, and the ISBN # as well as the actual review. Sure you can use the post title as the book title and you can use the body of the post as the review, but where do you put that author name and ISBN# so it will be displayed the same way every time? That’s a perfect place to use Custom Fields. I am going to show you what are Custom Post Types and how you can use them in your business.
Understanding Custom Post Types
To make this a little easier to understand, let’s continue with the Book Review scenario. With Custom Post Types (CPT), we will still be able to create “Pages” and “Posts”, but CPT allows us to create a new post type that we will call “Reviews”. In our Pages and Posts, we have a title and a featured image. In our new Reviews, we will use the title for the book title and we will use the featured image for the picture of the book, but we will also add more Custom Fields for the author’s name and the ISBN#. And, with plugins that extend the functionality of WordPress, we don’t even need to know how to code to create these Custom Post Types and Custom Fields.
Uses for Custom Post Types
Custom Post Types and Custom Fields can also be used to make portfolios, testimonials, staff pages, and much more. For one example, let’s look at the MarkNet website. If you take a look at our Our People page, you will see a listing of all our staff.
You’ll notice each person has the group they work with, their name, their title, and then a link to their full bio.
Creating Custom Post Types
To create a new post type for our team members, we could use a plugin like Toolset Types, which is free. Once you install it, simply go to Toolset > Post Types and then click on Add New. You will then be able to create your new post type by filling in a short form.
We create our plural name “Team Members” and then our singular, “Team Member”. Our slug will be “/team-member/”. I want them to show up in the dashboard under my Comments section, so I would choose that on the right from the dropdown. Once I do this, viola! My new custom post type is now on my dashboard so I can start creating new team members. I also chose a different icon to use in the WordPress dashboard navigation, but that is optional.
Creating Custom Fields
Once the new post type is created, we need to create the custom fields we want to use to add fields for their title, department, etc. We can continue to use Toolset to do this or we can use the Advanced Custom Fields plugin. Once we’ve installed this plugin, we simply go to Custom Fields > Add New and create our new fields. To keep all the fields for each post type together, the plugin wants you to create a new “Field Group” first. We’ll call ours “Team Member Options”, which you’ll see in a later screenshot.
The first custom field we’ll create will be for the team member’s title. For this, we just need a simple text box to insert the title. If we feel we’ll need a reminder of exactly what to put here, we can add instructions to help us out in the future, but this is pretty self-explanatory, so we can leave this box blank. There is also a place for a default value and placeholder text, but we know the answer to this is going to be different every time, so for this field, we’ll leave those blank and just fill out the field label (Team Member Title), the field name, which can’t have spaces so we need to use underscores here, and then we will choose the field type from the dropdown and choose the simplest option, the text field. Then there is the option to make this field required. Maybe we don’t want to allow any team members to be posted without a title, but in this case, we do want to be able to post without this information, so we are going to set it as not required.
The next group that we’re going to create will be the Team Member Category. That’s where we want to say if they are in the creative department, the SEO department, or the development department. We want the titles of these departments to be consistent every time without having to go back and check the website each time. We want this to be easy. We want them to have the same wording and be displayed the same way each time. So for this field type, we’re going to choose a “select” option, which will create a drop down. We’ll write each option on a separate line in the “Choices” field. Every time we enter a new team member, we won’t have to remember exactly what the department is called or how it’s displayed. We will simply choose from a dropdown list. Couldn’t be easier!
You can see here we created some fields within the group called Team Member Category, Team Member Title, and Team Member Category. There are also fields for uploading more pictures than just the featured image, as you can see we’ve done with the “Team Member Next Photo”.
Adding the Content
Once we have all our custom fields ready, we can start adding team members. We’ve chosen the newly created custom post type – Team Members > Add New from the dashboard and then you will see that we used the person’s name as the title and the featured image for their main photo. We’re able to select the category from that dropdown we’ve created and add the title in the text box we created.
Now go back to our Our People page to see how this all comes together so each team member is formatted the same way. From the screenshot above, you can see that we’ve also created custom post types for our services, testimonials, and portfolio.
Whatever you want to display on your website, Custom Post Types can help you do it. That’s what helps WordPress work for simple bloggers to Fortune 500 companies like Best Buy and Walt Disney. Put WordPress to work for you.
Tell us about your website project!