What are Custom Post Types?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey everyone welcome back to plug-in Hut your home for handcrafted WordPress plug-in tutorials as always I am your host Matt in my beautiful co-working office location we're going to talk about custom post types today what are custom post types how do they live inside of our WordPress website do you need them on our next project first let's explain what WordPress does with posts and pages this is a database if you think of WordPress as your database of content for all intents and purposes your database is storing posts and pages within it right so we're all familiar with posts and pages but then all of a sudden if we want to launch let's say a book store and there's you know hundreds of books that we want to sort of display on our website posts and pages really don't fit the bill for the most part you have your featured image which you could always put a featured image up there that's not a big deal post title that could be your book title and then a summary of the book but what about additional images or a book number or a SKU number or a price if we're actually selling these items if you think of what the most popular custom post type is in the WordPress world can you guess what that is probably not its WooCommerce products accessible commerce products are actually custom post types with custom fields and that is what really separates a custom post type from a traditional blog post let's say okay again big featured image post titles and either the content of your blog post or the content of your page is what makes up a traditional sort of post then we take those posts and we display them on the front end of our website you know in the collection of let's say a typical blog role three or four highlighted services on our home page or maybe even a team page where there's a collection of custom post types now when we create custom post types what we're doing is we're telling the WordPress database to say oh you have these posts oh you have these pages inside there but now I want to make a another collection in my database maybe it's called books and the books are going to start out just like every other page your post inside of my wordpress database we have a featured image a post title and a summary but the powerful thing with custom post types and what many many people do because custom post types make WordPress a true content management system you think about the content management you think about not just pages and posts but staff locations all of these bits of content that you want to store in this database and then display on your website now what do we do with books well we might actually have a price so we might actually add a price field inside of this custom post type called books okay along with price we might do something like SKU number and so on right so we might just add these custom fields to this post type and what that what not only does that solve for storing that information right storing that data alongside of this makes it easy for somebody to input this type of content in the backend of WordPress so if you're giving this to so another editor on the team somebody who controls their specific content type of books they can actually create their posts without having to sort of like put all of this stuff right it's a custom field into your typical editor space right because what you do and you're like putting in the price you're hitting enter a few times and you're putting in a SKU number and you're and you're hoping to do that the same way every time across a hundred different post types it'll never it will never happen plus when we want to display this information we want to display this on the home page of our website or any page right again if you think of WooCommerce as an example you go to the shop page the shop page displays all of your products doing it just like this it gets a featured image rights it's got the product image it's got the product name which in this case is the post title it's got maybe a short description of what that is but then it also has the price and it also has maybe the ship and how many are in stock or multiple prices with custom post types when you create these typically what you're doing is telling WordPress yeah I also want those custom fields on the front end of my website so when they click on an item over here right again a product a book a real estate listing it pulls this up it pulls up your single view what's known as the single in WordPress with not only that content but these fields okay that's what makes custom post types so darn powerful and you can make these infinitely well I guess I should there's probably some techie out there that'll say no matter is a limitation - about a terabyte of data or so on so forth depending on what database you're on so you can make these hundreds of these if you if you will to organize and create richer more broad and just a sweeping different amount of content outside of pages and posts custom post types really makes it super easy now on the channel and not in this video we'll covered many ways to create custom post types there are plenty of plugins out there maybe what I'll do is just leave them in the description of this particular video I'm not going to cover them here so I just want to recap where we're at with custom post types we're looking in our WordPress database and our WordPress database says hey man we have posts and pages and oh by the way you created a new custom post type called books and then within the custom post type itself let's say this is my books custom post type I can have my featured image I can create my post title I can create a description about this book and then oh by the way I've added two custom fields you can add as many custom fields as you want it depends on what your what you're after what type of content that we're displaying here on the front end of your website what words what you're going to tell WordPress to do is hey display those custom post types display that team directory that book collection that ecommerce store display that on a specific page or on bits of that on my home page and do these specific custom fields price of a house square footage of a house MLS number of a house all of those custom fields all that data can be stored inside of custom fields once again attached to your custom post type I hope that makes sense I just want to stop a normal sort of tutorial and give you a little bit of insight of into custom post types and other things that you can do with WordPress beyond sort of just the traditional plugin tutorial that we do here thanks for watching I really hope you enjoyed it hope you found it fairly useful if you do go ahead and thumbs up the video go ahead and like the channel subscribe to the channel Williams com we'll see you in the next [Music]
Info
Channel: PluginTut WordPress tutorials
Views: 42,984
Rating: undefined out of 5
Keywords: WordPress, What are custom post types, custom post types, WordPress CPTs
Id: Orrn9f-L0mI
Channel Id: undefined
Length: 7min 33sec (453 seconds)
Published: Wed Mar 08 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.