Displaying Custom Post Types – Templates and Querying

This is the 3rd and final article of our series on Custom Post Types (CPT). The topics we discussed in the first two were: Custom Post Types (how to create them) Custom Taxonomies In the first and second articles, we registered the testimonials custom post type and the testimonial_service custom taxonomy. We now have to display the testimonials on our site. So we will take a look at how to create a template for our testimonials, how to query them, and how to display them anywhere on our site. Default Custom Post Type Templates We created our CPT with the parameter has_archive set to true, which...

How to Convert or Change Custom Post Types in WordPress

WordPress uses a variety of post types to manage content in your site. These include posts, pages, menus, attachments and revisions. You can also create custom post types to serve many purposes. But what do you do when you want to convert custom post types in WordPress? You might have instances where one piece of content is better suited as a specific post type in your website. In that case, you need something like a post type switcher. In this tutorial, I’ll show you how to change post types in WordPress using a simple plugin. You don’t need to worry...

How to Use Gutenberg with WordPress Custom Post Types

Over the years, the WordPress community has been using WordPress Custom Post Types (CPT) for extending the functionality of the default WordPress platform. Given the popularity, the feature is an integral part of WordPress 5.x. The Latest “Super” Tool in WordPress: Gutenberg EditorWith the current version of WordPress ( 5.1 RC), Gutenberg is only visible for the default pages and post types. Since WordPress custom post types are almost everywhere, the unavailability of Gutenberg editor is something that the community has been talking about since the release of WordPress 5.0. This means that if you have CPT on your WordPress...

WordPress Custom Post Types: The All-In-One Guide to Create and Use Them

Most custom post types you add to your site will work like posts, which means they’re designed to be displayed in archive pages. Maybe you’re using a custom taxonomy to display them, or maybe you’ve added the “category” taxonomy like I have. Alternatively, if you’ve used a plugin like WooCommerce that adds custom post types in order to add specific functionality to your site, then that plugin might add some specific pages (like the “Shop2 page) designed to output your custom post type. The four options you have for displaying custom post types are: Displaying the individual post (i.e. the...