Tech How to Create Custom Post Types in WordPress Uneeb KhanOctober 20, 20220151 views Want to learn how easy it is to create custom post types in WordPress? Custom post types turn a WordPress site from a blogging platform into a powerful content management system (CMS). Essentially, they allow you to go beyond posts and pages by creating different types of content for your site. In this article, we will show you how easy it is to create custom post types in WordPress. We will teach you two methods, and you can choose the one that is more convenient for you. Get your WordPress developer Manchester. Table of Contents What is a custom post type in WordPress?When do I need a custom post type?Display custom post types on your siteDisplay a custom post type using the default archive templateUsing custom templates for CPT archives and single recordsDisplay custom post types in widgetsAdditional settings for custom message types What is a custom post type in WordPress? Custom post types are content types such as posts and pages. As WordPress has evolved from a simple blogging platform to a robust CMS, the term “post” has stuck with it. However, the message type can be any content. By default, WordPress comes with the following post types: MessagePageThe attachmentEditorialNavigation menu You can create your own post types and name them whatever you want. For example, if you have a movie review website, you might want to create a movie review post type. This post type can have various custom fields and even its own custom category structure. Other examples of post types are portfolio, testimonials, products, etc. Many popular WordPress plugins already use custom post types to store data on your WordPress website. Below are some of the best plugins that use custom post types. WooCommerce – Adds a custom product post type to your WordPress site.WPForms – Creates a wpforms post type to hold all your forms.MemberPress – adds a memberpressproduct custom post type When do I need a custom post type? Check out our article on when you really need custom post types or taxonomies in WordPress. You will also notice that we use our own taxonomies for them instead of categories or tags. That being said, let’s see how easy it is to create custom post types in WordPress for your own use. Method 1: Create a custom post type – the easy way The easiest way to create your own post type in WordPress is to use a plugin. This method is recommended for beginners because it is safe and very easy. The first thing you need to do is install and activate the Custom Post Type UI plugin. Upon activation, the plugin will add a new item to the WordPress admin menu called CPT UI. Now go to CPT UI » Add New to create a new custom post type. First, you need to provide a label for your custom post type. This slug will be used in the URL and in WordPress queries, so it can only contain letters and numbers. Below you need to provide the plural and singular names for your custom post type. You can then optionally click on the “Fill additional labels based on selected labels” link. The rest of the label fields will be filled in below. Scroll down to the “Additional Labels” section, where you can provide a description of your post type and change the labels. Labels will be used throughout the WordPress user interface when you manage content in that particular post type. Next comes the option to customize the message type. From here, you can set up various attributes for your post type. Each option comes with a short description explaining what it does. Finally, click the “Add Post Type” button to save and create your own post type. That’s it, you have successfully created your custom post type. You can go ahead and start adding content. Later in this article, we’ll show you how to display a custom post type on your website. Display custom post types on your site WordPress has built-in support for displaying your custom post types. Once you’ve added a few elements to your new custom post type, it’s time to display them on your website. You can use several methods, each with its own benefits. Display a custom post type using the default archive template First, you can simply go to Appearance » Menu and add a custom link to your menu. This custom link is a link to your custom post type. Using custom templates for CPT archives and single records If you don’t like the look of the archive page for your custom post type, you can use a custom post type archive template. To do this, all you have to do is create a new file in your theme directory and name it archive-movies.php. Replace movies with the name of your custom post type. To get started, you can copy the contents of archive.phpyour theme file into a template archive-movies.phpand then start modifying it to suit your needs. Now whenever the archive page for your custom post type is opened, this template will be used to display it. Similarly, you can also create your own template to display individual posts of your type. To do this, you need to create a file single-movies.phpin your theme directory. Don’t forget to replace movies with the name of your own post type. You can get started by copying the contents of single.phpyour theme’s template into a template single-movies.phpand then start modifying it to suit your needs. Display custom post types in widgets You’ll notice that WordPress has a default widget for displaying recent posts, but it doesn’t let you choose your own post type. What if you want to display the latest posts from a newly created post type in a widget? Is there an easy way to do this. The first thing you need to do is install and activate the Ultimate Posts Widget plugin. Upon activation, simply go to Appearance » Widgets and drag the Ultimate Posts widget to the sidebar. This powerful widget will allow you to display the latest posts from any post type. You can also display excerpts from posts with a Read More link, or even display a featured image next to the post title. Customize the widget by choosing the options you want and choosing your own post type. After that, save your changes and see the widget in action on your site. Read more What is the Cost for WordPress Premium Support Additional settings for custom message types You can do a lot more with your custom post types. You can learn how to add your own post types to the main RSS feed or create separate feeds for each custom post type. For more tips, see our list of the most helpful guides to custom WordPress post types. If you are looking for a code-free solution to customize custom archive pages, then we recommend taking a look at a WordPress page builder plugin like Beaver Builder or Divi because both of them can help you with this. We have web application development expert liverpool. We hope this article helped you learn how to create custom post types in WordPress. You can also check out our guide on how to increase your website traffic with practical tips.