What is a Custom Post Type (CPT)?
Custom post types allow you to go beyond posts and pages and create different content types for your website. They transform your WordPress site from a blogging platform into a powerful content management system (CMS). You can create your own post types, known as custom post types. These are useful when creating content that has a different format than a standard post or page. For instance, if you run a movie review website, then you would probably want to create a movie reviews post type. You could also create custom post types for portfolios, testimonials, and products. Custom post types can have different custom fields and their own custom category structure.
How to Create a CPT
- Go to CPT UI » Add / Edit Post Types to create a new custom post type. You should be on the ‘Add New Post Type’ tab.
- First, you need to provide a slug for your custom post type, such as ‘movies’.
- This slug will be used in the URL and in WordPress queries, so it can only contain letters and numbers.
- Below that, you need to provide the plural and singular names for your custom post type.
- Skip over the Additional Labels section
- Next comes the post-type settings. From here you can set up different attributes for your post type. Each option comes with a brief description explaining what it does. The majority of the CPTs should have the following:
- Has Archive set to True
- Change Capability Type from post to page
- Custom Rewrite Slug
- If the slug of the CPT contains spaces it will convert the spaces into underscores, here you will convert the underscores into hyphens for example:
- meet_the_team » meet-the-team
- Menu Position set to 5
- Menu Icon click the Choose dash icon button and select a fitting icon
- Supports – Leave as is (this may change based on the CPT)
- Custom “Supports” paste genesis-cpt-archives-settings
- Click Save Post Type and then you will see your new CPT on the admin menu
Additional Resource:
https://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/
Archive vs. Single
WordPress will, by default, uses the single.php and archive.php templates of your theme for the front-end design of custom post types. However, when a specific template exists for custom post types, single-{post-type}.php and archive-{post-type}.php will override the defaults in WordPress.
What is an Archive
Archive pages are generated to organize a list of posts under a specific post type, category, or tag. The archive page has multiple benefits. First of all, it can radically improve SEO and help your audience to find the desired content. Secondly, the archive page is a practical way to display all published pages and different post types. It will ease the navigation process. How? By listing your old content based on a date, category, tags, and more. WordPress creates archive pages automatically. So, you don’t need to waste your time making it from scratch. Yet, customization of your archive page can boost your traffic. And better the appearance and the performance of your site.
What is a Single
A single is a singular post in a specific post type. For example, when it comes to JSMT Media, one of the custom post types is called Services one of the single services is Web Design.