Creating a Custom Post Type for Elearning Videos

In my last blog post I mentioned that I wanted to create a custom post type for videos in WordPress here on SelfAssemblySites.

What's a custom post type?

The concept is a lot simpler than it sounds. First some background: WordPress comes with two primary post types* already created for you - blog posts** - aka "Posts" with a capital 'P' - and site pages - aka "Pages" with a capital 'P'.

Custom Post Types are simply other types of content rather than Pages or Posts, that can be displayed on your WordPress website. The type that I want to add is called Video - I want to add this special post type because I want to  include additional meta data like video runtime, a summary of what's in the video, a difficulty level, etc.

This image to the right is from our WordPress admin area shows how they appear once I've added them (code below). You can Add New Videos, view a list of videos just like viewing your Pages or Posts, etc.

What's so great about that?

The real power is the meta data I mentioned - you can add and classify your content by all sorts of different criteria. For example, you could create a Movies custom post type, and add Director and Leading Actor information. You could create a movie reviews site, or even a site like IMDB (with a bit of work) :)

How I've used it

When you add a custom post type, you'll normally want to add input fields into the custom post type's Add New and Edit screens - I've included a screenshot below to show you what I've added to our Video custom post type. It's pretty self-explanatory, but leave a comment below if you have any questions or suggestions - thanks for reading!

* WordPress also comes with some other post types used to store menus and other stuff).
** You can tell WordPress has its roots in blogging, because Posts is given primary position at the top of the Admin menu, but custom post types are one contributing factor to why it's the most popular CMS in use today.

About Alastair McDermott

Alastair McDermott is an online business and technology consultant specialising in web design & development, internet marketing and search engine optimisation. He has been building websites and software since 1996 and is a ten year veteran of using WordPress.

Alastair blogs and makes media of all kinds at WebsiteDoctor. Follow him on Twitter at @WebsiteDoctor.

Leave a Reply

Your email address will not be published. Required fields are marked *