Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m

Next lesson playing in 5 seconds

Cancel

Free Preview: Using Custom Content Types in WordPress

Introduction

00:50
  • Overview
  • Transcript

WordPress is a powerful and easy-to-use content management system (CMS) out of the box. The default "Page" and "Post" content types are enough for many websites and blogs. In order to really harness the power of WordPress as a CMS, though, you'll want to create custom content types with fields and taxonomies specific to your particular application.

In this course, Envato Tuts+ instructor Rachel McCollin will show you how to create custom content types in WordPress. You'll learn how custom content types work with the WordPress database, plugin and templating system. Along the way, you'll use custom post types, custom taxonomies, and custom fields to build a simple astronomy CMS for displaying information about the largest moons in the solar system!

Do you want to learn WordPress development from start to finish? Check out our learning guide: Learn WordPress Development.

Build on your WordPress theme development skills in these courses:

1. Introduction

1.1 Introduction

Hello, and welcome to this Tuts+ course on custom content types in WordPress. In this course, you're gonna work with me to create a website using three types of custom content. The first custom content type will be a post type, and that will be moons, because this is an astronomy site. You'll also create a custom taxonomy of planet, which will apply to our moon. And then we'll move to looking at Custom Fields, or post-metadata. We'll look at how you use the default WordPress admin to create Custom Fields, and then we'll also create custom meta boxes so that we have a more user-friendly interface. Once you've done that you'll have a site that displays information about moons using custom content types as well as some custom templates which we'll create as we work along. In the next part of the course we'll look at some real life examples of cites using custom content types. See you next time and thanks for watching.

2. Custom Post Types

2.1 Custom Post Types in Action

Hello and welcome back to this tuts+ course on custom content types in WordPress. In this part of the course, I'm gonna show you a few real world examples of sites using custom content types. All of these use custom post types, and some of them also use custom taxonomies, which are attributed to those custom post types. The first one is the site from my own agency, Compass Design. Now this one is mainly page based because it has information on all the services I offer, but it also has a blog which uses normal, standard posts. And then, in addition to that it has a portfolio and that portfolio uses a custom post type of portfolio item. So, that's a really simple use of custom post times. Here's another site that I've developed that uses custom post types and custom taxonomies in much more detail. So, this site uses standard pages, for example, there's a page here for the Head's Welcome. But it also uses a lot of custom post types. So, custom post types are used to store information on the curriculum, like homework, the levels the children are expected to be working at, information on what children will be studying and links to resources. There's also custom post type for staff members. And in each page for a subject area, it shows you the information about that curriculum, and the staff, and also learning links. Which is another custom post types. And it uses custom taxonomies relating to the subject areas and also the years groups to display all of those post types in the relevant subject page or you group page. Meaning that staff can add things once, and they'll pop up all over the website as relevant. Here's another site I've developed that uses custom post types and this is for a coffee shop. This also includes a shop because this business also sells reproduction crockery as well as vouchers that you can use in the coffee shop, so here there are a number of items. Now I've used a plugin, I've used a WooCommerce plugin for this, but WooCommerce also creates its own custom post types, and it creates custom taxonomies that go with those custom post types. So the custom post type is product, and the custom taxonomies include product categories as well as any attributes you set up using WooCommerce. The fourth site I'll show you uses custom content types not only to power the shop, because it sells various items relating to the client's business, but it also uses custom content types for the content of the website itself. So, there are lots of static pages, and there's also a blog, which includes standard posts. But as well as standard posts, it uses a post type called resources. And this is used to store resources that the TypeAcademy have created and make available to their clients. And here you can see that there are taxonomies applied to these resources, so most of these items here are in the resources post type, so they're posts created using that resource. These heading here relate to the taxonomies that are relevant. And as well as that, there is a taxonomy of temperament which also used to categorized them. Here, we're actually using pages and you can apply a taxonomy to a page as well as to a custom post time and list it in any way you want to. So, those are some examples of websites using custom content types to display information in a way that's very different from the standard blog. In this course, you're gonna learn how to do that by creating custom post types, custom taxonomies and custom fields. And in the next part of the course, we'll start with custom post types and you'll learn more about exactly how they work before you go on to creating your own. See you next time and thanks for watching.