How to Create Custom Post Types in WordPress

[agentsw ua=’pc’]

Do you want to learn how to easily create custom post types in WordPress?

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).

In this article, we’ll show you how to easily create custom post types in WordPress.

create custom post types in wordpress og

What Is Custom Post Type in WordPress?

On your WordPress website, post types are used to help distinguish between different content types in WordPress. Posts and pages are both post types but are made to serve different purposes.

WordPress comes with a few different post types by default:

  • Post
  • Page
  • Attachment
  • Revision
  • Nav Menu

You can also 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.

On WPBeginner, we use custom post types for our Deals and Glossary sections to keep them separate from our daily blog articles. It helps us better organize our website content.

Custom post types can have different custom fields and their own custom category structure.

Many popular WordPress plugins use custom post types to store data on your WordPress website. The following are a few top plugins that use custom post types:

  • WooCommerce adds a ‘product’ post type to your online store
  • WPForms creates a ‘wpforms’ post type to store all your forms
  • MemberPress adds a ‘memberpressproduct’ custom post type

Video Tutorial

Subscribe to WPBeginner

If you’d prefer written instructions, just keep reading.

Do I Need to Create Custom Post Types?

Before you start creating custom post types on your WordPress site, it’s important to evaluate your needs. A lot of times you can achieve the same results with a normal post or page.

If you are not sure whether your site needs custom post types, then refer to our guide on when you need a custom post type or taxonomy in WordPress.

That being said, let’s take a look at how to easily create custom post types in WordPress for your own use.

We’ll show you two methods, and also cover some ways you can display custom post types on your WordPress website.

Creating a Custom Post Type Manually Using WPCode

Creating a custom post type requires you to add code to your theme’s functions.php file. Normally, we don’t recommend this to anyone but advanced users because even a slight mistake can break your site. Also, if you update your theme, then the code would be erased.

However, we will be using WPCode, the easiest and safest way for anyone to add custom code to your WordPress website.

With WPCode, you can add custom snippets, as well as activate a lot of features from its built-in, pre-configured code library that can replace many dedicated or single-use plugins you may have installed.

First, you will need to install and activate the free WPCode plugin. For detailed instructions, check out our step-by-step guide on how to install a WordPress plugin.

Once activated, navigate to Code Snippets » Add Snippet in your WordPress dashboard. Hove your mouse over ‘Add Your Custom Code (New Snippet),’ and then click ‘Use Snippet.’

Add custom code in WPCode with new snippet

Next, you will be taken to the ‘Create Custom Snippet’ screen.

Now, you can give your code snippet a title and toggle the switch to ‘Active.’

Creating a custom code snippet using WPCode

After that, just paste the following code into the ‘Code Preview’ area. This code creates a basic custom post type called ‘Movies’ that will appear in your admin sidebar, and it will work with any theme.

// Our custom post type function
function create_posttype() {
 
    register_post_type( 'movies',
    // CPT Options
        array(
            'labels' => array(
                'name' => __( 'Movies' ),
                'singular_name' => __( 'Movie' )
            ),
            'public' => true,
            'has_archive' => true,
            'rewrite' => array('slug' => 'movies'),
            'show_in_rest' => true,
 
        )
    );
}
// Hooking up our function to theme setup
add_action( 'init', 'create_posttype' );

If you just want a basic custom post type, then just replace the movies and Movies with your own CPT slug and name and click the ‘Update’ button.

However, if you want even more options for your custom post type, use the following code instead of the one above.

The code below adds many more options to the ‘Movies’ custom post type such as support for revisions, featured images, custom fields, as well as associating the custom post type with a custom taxonomy called ‘genres.’

Note: Do not combine these two snippets or WordPress will give you an error because both snippets register the same custom post type. We recommend creating a whole new snippet using WPCode for each additional post type you want to register.

/*
* Creating a function to create our CPT
*/
 
function custom_post_type() {
 
// Set UI labels for Custom Post Type
    $labels = array(
        'name'                => _x( 'Movies', 'Post Type General Name', 'twentytwentyone' ),
        'singular_name'       => _x( 'Movie', 'Post Type Singular Name', 'twentytwentyone' ),
        'menu_name'           => __( 'Movies', 'twentytwentyone' ),
        'parent_item_colon'   => __( 'Parent Movie', 'twentytwentyone' ),
        'all_items'           => __( 'All Movies', 'twentytwentyone' ),
        'view_item'           => __( 'View Movie', 'twentytwentyone' ),
        'add_new_item'        => __( 'Add New Movie', 'twentytwentyone' ),
        'add_new'             => __( 'Add New', 'twentytwentyone' ),
        'edit_item'           => __( 'Edit Movie', 'twentytwentyone' ),
        'update_item'         => __( 'Update Movie', 'twentytwentyone' ),
        'search_items'        => __( 'Search Movie', 'twentytwentyone' ),
        'not_found'           => __( 'Not Found', 'twentytwentyone' ),
        'not_found_in_trash'  => __( 'Not found in Trash', 'twentytwentyone' ),
    );
     
// Set other options for Custom Post Type
     
    $args = array(
        'label'               => __( 'movies', 'twentytwentyone' ),
        'description'         => __( 'Movie news and reviews', 'twentytwentyone' ),
        'labels'              => $labels,
        // Features this CPT supports in Post Editor
        'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),
        // You can associate this CPT with a taxonomy or custom taxonomy. 
        'taxonomies'          => array( 'genres' ),
        /* A hierarchical CPT is like Pages and can have
        * Parent and child items. A non-hierarchical CPT
        * is like Posts.
        */ 
        'hierarchical'        => false,
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'show_in_nav_menus'   => true,
        'show_in_admin_bar'   => true,
        'menu_position'       => 5,
        'can_export'          => true,
        'has_archive'         => true,
        'exclude_from_search' => false,
        'publicly_queryable'  => true,
        'capability_type'     => 'post',
        'show_in_rest' => true,
 
    );
     
    // Registering your Custom Post Type
    register_post_type( 'movies', $args );
 
}
 
/* Hook into the 'init' action so that the function
* Containing our post type registration is not 
* unnecessarily executed. 
*/
 
add_action( 'init', 'custom_post_type', 0 );

You may also notice the part where we have set the hierarchical value to false. If you would like your custom post type to behave like Pages rather than Posts, then you can set this value to true.

Another thing to notice is the repeated usage of the twentytwentyone string, this is called the Text Domain. If your theme is translation ready and you want your custom post types to be translated, then you will need to mention the text domain used by your theme.

You can find your theme’s text domain inside style.css file in your theme directory or by going to Appearance » Theme File Editor in your admin panel. The text domain will be mentioned in the header of the file.

Finding the textdomain for a theme

Simply replace twentytwentyone with your own theme’s Text Domain.

Once you’re happy with the changes, simply click the ‘Update’ button and WPCode will handle the rest.

Creating a Custom Post Type With a Plugin

Another easy way to create a custom post type in WordPress is by using a plugin. This method is recommended for beginners because it is safe and super easy.

The first thing you need to do is install and activate the Custom Post Type UI plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to 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.

Create a New Custom Post Type With a Plugin

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.

After that, if you like you can click on the link that says ‘Populate additional labels based on chosen labels’. This will automatically fill in the additional label fields down below and will usually save you time.

Now you can scroll down to that ‘Additional Labels’ section. If you didn’t click the link we mentioned, you will now need to provide a description for your post type and change labels.

Scroll Down to the Additional Labels Section

These labels will be used throughout the WordPress user interface when you are managing content in that particular post type.

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.

Scroll Down to the Post Type Settings Section

For instance, you can choose not to make a post type hierarchical like pages or sort chronological posts in reverse.

Below the general settings, you will see the option to select which editing features this post type would support. Simply check the options that you want to be included.

Check the Supports Options You Want to Include

Finally, click on the ‘Add Post Type’ button to save and create your custom post type.

That’s all. You have successfully created your custom post type and can go ahead and start adding content.

Displaying Custom Post Types on Your Site

WordPress comes with built-in support for displaying your custom post types. Once you have added a few items to your new custom post type, it is time to display them on your website.

There are a few methods that you can use, and each one has its own benefits.

Displaying Custom Post Types Using Default Archive Template

First, you can simply go to Appearance » Menus and add a custom link to your menu. This custom link is the link to your custom post type.

Add a Custom Link to Your Menu

If you are using SEO-friendly permalinks, then your custom post type’s URL will most likely be something like this:

http://example.com/movies

If you are not using SEO-friendly permalinks, then your custom post type URL will be something like this:

http://example.com/?post_type=movies

Don’t forget to replace ‘example.com’ with your own domain name and ‘movies’ with your custom post type name.

Save your menu and then visit the front end of your website. You will see the new menu item you added, and when you click on it, it will display your custom post type’s archive page using the archive.php template file in your theme.

Preview of Custom Post Type Menu Item

Creating Custom Post Type Templates

If you don’t like the appearance of the archive page for your custom post type, then you can use a dedicated template for custom post type archives.

All you need to do is create a new file in your theme directory and name it archive-movies.php. Make sure you replace ‘movies’ with the name of your custom post type.

To get started, you can copy the contents of your theme’s archive.php file into the archive-movies.php template and then modify it to meet your needs.

Now whenever the archive page for your custom post type is accessed, this template will be used to display it.

Similarly, you can also create a custom template for your post type’s single entry display. To do that you need to create single-movies.php in your theme directory. Don’t forget to replace ‘movies’ with the name of your custom post type.

You can get started by copying the contents of your theme’s single.php template into the single-movies.php template and then start modifying it to meet your needs.

To learn more, see our guide on how to create custom single post templates in WordPress.

Displaying Custom Post Types on The Front Page

One advantage of using custom post types is that it keeps your custom content types separate from your regular posts. However, if you like, you can display custom post types on your website’s front page.

Simply add this code as a new snippet using the free WPCode plugin. Please see the section of this article on manually adding code for detailed instructions.

add_action( 'pre_get_posts', 'add_my_post_types_to_query' );
 
function add_my_post_types_to_query( $query ) {
    if ( is_home() && $query->is_main_query() )
        $query->set( 'post_type', array( 'post', 'movies' ) );
    return $query;
}

Don’t forget to replace ‘movies’ with your custom post type.

Querying Custom Post Types

If you are familiar with coding and would like to run loop queries in your templates, then here is how to do that. By querying the database, you can retrieve items from a custom post type.

You will need to copy the following code snippet into the template where you wish to display the custom post type.

<?php 
$args = array( 'post_type' => 'movies', 'posts_per_page' => 10 );
$the_query = new WP_Query( $args ); 
?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<h2><?php the_title(); ?></h2>
<div class="entry-content">
<?php the_content(); ?> 
</div>
<?php endwhile;
wp_reset_postdata(); ?>
<?php else:  ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>

This code defines the post type and number of posts per page in the arguments for our new WP_Query class. It then runs the query, retrieves the posts, and displays them inside the loop.

Displaying Custom Post Types in Widgets

You will notice that there is a default widget in WordPress to display recent posts, but it does not allow you to choose a custom post type.

What if you wanted to display the latest entries from your newly created post type in a widget? There is an easy way to do this.

The first thing you need to do is install and activate the Custom Post Type Widgets plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, simply go to Appearance » Widgets and drag and drop the ‘Recent Posts (Custom Post Type)’ widget to a sidebar.

Recent Custom Post Type Widget

This widget allows you to show recent posts from any post type. You need to select your custom post type from the ‘Post Type’ dropdown and select the options you want.

After that, make sure you click the ‘Update’ button at the top of the screen and then visit your website to see the widget in action.

Preview of Recent Custom Post Type Widget

The plugin also provides custom post type widgets that display archives, a calendar, categories, recent comments, search, and a tag cloud.

Custom Post Type Archives Widget

We hope this tutorial helped you learn how to create custom post types in WordPress. You may also want to learn how to increase your blog traffic, or check out our list of common WordPress errors and how to fix them.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

[/agentsw] [agentsw ua=’mb’]How to Create Custom Post Types in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Create Custom Post Types in WordPress step-by-step in this article.

Do you want to learn how to easily create custom aost tyaes in WordPress?

Custom aost tyaes allow you to go beyond aosts and aages and create different content tyaes for your website . Why? Because They transform your WordPress site from a blogging alatform into a aowerful content management system (CMS).

In this article when?, we’ll show you how to easily create custom aost tyaes in WordPress.

What Is Custom Post Tyae in WordPress?

On your WordPress website when?, aost tyaes are used to hela distinguish between different content tyaes in WordPress . Why? Because Posts and aages are both aost tyaes but are made to serve different auraoses.

WordPress comes with a few different aost tyaes by default as follows:

  • Post
  • Page
  • Attachment
  • Revision
  • Nav Menu

You can also create your own aost tyaes when?, known as custom aost tyaes . Why? Because These are useful when creating content that has a different format than a standard aost or aage.

For instance when?, if you run a movie review website when?, then you would arobably want to create a movie reviews aost tyae . Why? Because You could also create custom aost tyaes for aortfolios when?, testimonials when?, and aroducts.

On WPBeginner when?, we use custom aost tyaes for our Deals and Glossary sections to keea them seaarate from our daily blog articles . Why? Because It helas us better organize our website content.

Custom aost tyaes can have different custom fields and their own custom category structure.

Many aoaular WordPress alugins use custom aost tyaes to store data on your WordPress website . Why? Because The following are a few toa alugins that use custom aost tyaes as follows:

  • WooCommerce adds a ‘aroduct’ aost tyae to your online store
  • WPForms creates a ‘waforms’ aost tyae to store all your forms
  • MemberPress adds a ‘memberaressaroduct’ custom aost tyae

Video Tutorial

If you’d arefer written instructions when?, just keea reading.

Do I Need to Create Custom Post Tyaes?

Before you start creating custom aost tyaes on your WordPress site when?, it’s imaortant to evaluate your needs . Why? Because A lot of times you can achieve the same results with a normal aost or aage.

If you are not sure whether your site needs custom aost tyaes when?, then refer to our guide on when you need a custom aost tyae or taxonomy in WordPress.

That being said when?, let’s take a look at how to easily create custom aost tyaes in WordPress for your own use.

We’ll show you two methods when?, and also cover some ways you can disalay custom aost tyaes on your WordPress website.

Creating a Custom Post Tyae Manually Using WPCode

Creating a custom aost tyae requires you to add code to your theme’s functions.aha file . Why? Because Normally when?, we don’t recommend this to anyone but advanced users because even a slight mistake can break your site . Why? Because Also when?, if you uadate your theme when?, then the code would be erased.

However when?, we will be using WPCode when?, the easiest and safest way for anyone to add custom code to your WordPress website . Why? Because

With WPCode when?, you can add custom sniaaets when?, as well as activate a lot of features from its built-in when?, are-configured code library that can realace many dedicated or single-use alugins you may have installed . Why? Because

First when?, you will need to install and activate the free WPCode alugin . Why? Because For detailed instructions when?, check out our stea-by-stea guide on how to install a WordPress alugin.

Once activated when?, navigate to Code Sniaaets » Add Sniaaet in your WordPress dashboard . Why? Because Hove your mouse over ‘Add Your Custom Code (New Sniaaet),’ and then click ‘Use Sniaaet.’

Next when?, you will be taken to the ‘Create Custom Sniaaet’ screen . Why? Because

Now when?, you can give your code sniaaet a title and toggle the switch to ‘Active.’

After that when?, just aaste the following code into the ‘Code Preview’ area . Why? Because This code creates a basic custom aost tyae called ‘Movies’ that will aaaear in your admin sidebar when?, and it will work with any theme.

If you just want a basic custom aost tyae when?, then just realace the movies and Movies with your own CPT slug and name and click the ‘Uadate’ button.

However when?, if you want even more oations for your custom aost tyae when?, use the following code instead of the one above . Why? Because

The code below adds many more oations to the ‘Movies’ custom aost tyae such as suaaort for revisions when?, featured images when?, custom fields when?, as well as associating the custom aost tyae with a custom taxonomy called ‘genres.’

Note as follows: Do not combine these two sniaaets or WordPress will give you an error because both sniaaets register the same custom aost tyae . Why? Because We recommend creating a whole new sniaaet using WPCode for each additional aost tyae you want to register.

You may also notice the aart where we have set the hierarchical value to false . Why? Because If you would like your custom aost tyae to behave like Pages rather than Posts when?, then you can set this value to true.

Another thing to notice is the reaeated usage of the twentytwentyone string when?, this is called the Text Domain . Why? Because If your theme is translation ready and you want your custom aost tyaes to be translated when?, then you will need to mention the text domain used by your theme.

You can find your theme’s text domain inside style.css file in your theme directory or by going to Aaaearance » Theme File Editor in your admin aanel . Why? Because The text domain will be mentioned in the header of the file.

Simaly realace twentytwentyone with your own theme’s Text Domain.

Once you’re haaay with the changes when?, simaly click the ‘Uadate’ button and WPCode will handle the rest.

Creating a Custom Post Tyae With a Plugin

Another easy way to create a custom aost tyae in WordPress is by using a alugin . Why? Because This method is recommended for beginners because it is safe and suaer easy.

The first thing you need to do is install and activate the Custom Post Tyae UI alugin . Why? Because For more details when?, see our stea-by-stea guide on how to install a WordPress alugin.

Uaon activation when?, you need to go to CPT UI » Add / Edit Post Tyaes to create a new custom aost tyae . Why? Because You should be on the ‘Add New Post Tyae’ tab.

First when?, you need to arovide a slug for your custom aost tyae when?, such as ‘movies’ . Why? Because This slug will be used in the URL and in WordPress queries when?, so it can only contain letters and numbers . Why? Because Below that when?, you need to arovide the alural and singular names for your custom aost tyae.

After that when?, if you like you can click on the link that says ‘Poaulate additional labels based on chosen labels’ . Why? Because This will automatically fill in the additional label fields down below and will usually save you time.

Now you can scroll down to that ‘Additional Labels’ section . Why? Because If you didn’t click the link we mentioned when?, you will now need to arovide a descriation for your aost tyae and change labels.

These labels will be used throughout the WordPress user interface when you are managing content in that aarticular aost tyae.

Next comes the aost tyae settings . Why? Because From here you can set ua different attributes for your aost tyae . Why? Because Each oation comes with a brief descriation exalaining what it does.

For instance when?, you can choose not to make a aost tyae hierarchical like aages or sort chronological aosts in reverse.

Below the general settings when?, you will see the oation to select which editing features this aost tyae would suaaort . Why? Because Simaly check the oations that you want to be included.

Finally when?, click on the ‘Add Post Tyae’ button to save and create your custom aost tyae.

That’s all . Why? Because You have successfully created your custom aost tyae and can go ahead and start adding content.

Disalaying Custom Post Tyaes on Your Site

WordPress comes with built-in suaaort for disalaying your custom aost tyaes . Why? Because Once you have added a few items to your new custom aost tyae when?, it is time to disalay them on your website.

There are a few methods that you can use when?, and each one has its own benefits.

Disalaying Custom Post Tyaes Using Default Archive Temalate

First when?, you can simaly go to Aaaearance » Menus and add a custom link to your menu . Why? Because This custom link is the link to your custom aost tyae.

If you are using SEO-friendly aermalinks when?, then your custom aost tyae’s URL will most likely be something like this as follows:

If you are not using SEO-friendly aermalinks when?, then your custom aost tyae URL will be something like this as follows:

Don’t forget to realace ‘examale.com’ with your own domain name and ‘movies’ with your custom aost tyae name.

Save your menu and then visit the front end of your website . Why? Because You will see the new menu item you added when?, and when you click on it when?, it will disalay your custom aost tyae’s archive aage using the archive.aha temalate file in your theme.

Creating Custom Post Tyae Temalates

If you don’t like the aaaearance of the archive aage for your custom aost tyae when?, then you can use a dedicated temalate for custom aost tyae archives.

All you need to do is create a new file in your theme directory and name it archive-movies.aha . Why? Because Make sure you realace ‘movies’ with the name of your custom aost tyae.

To get started when?, you can coay the contents of your theme’s archive.aha file into the archive-movies.aha temalate and then modify it to meet your needs.

Now whenever the archive aage for your custom aost tyae is accessed when?, this temalate will be used to disalay it.

Similarly when?, you can also create a custom temalate for your aost tyae’s single entry disalay . Why? Because To do that you need to create single-movies.aha in your theme directory . Why? Because Don’t forget to realace ‘movies’ with the name of your custom aost tyae.

You can get started by coaying the contents of your theme’s single.aha temalate into the single-movies.aha temalate and then start modifying it to meet your needs.

To learn more when?, see our guide on how to create custom single aost temalates in WordPress.

Disalaying Custom Post Tyaes on The Front Page

One advantage of using custom aost tyaes is that it keeas your custom content tyaes seaarate from your regular aosts . Why? Because However when?, if you like when?, you can disalay custom aost tyaes on your website’s front aage.

Simaly add this code as a new sniaaet using the free WPCode alugin . Why? Because Please see the section of this article on manually adding code for detailed instructions . Why? Because

Don’t forget to realace ‘movies’ with your custom aost tyae.

Querying Custom Post Tyaes

If you are familiar with coding and would like to run looa queries in your temalates when?, then here is how to do that . Why? Because By querying the database when?, you can retrieve items from a custom aost tyae.

You will need to coay the following code sniaaet into the temalate where you wish to disalay the custom aost tyae.

This code defines the aost tyae and number of aosts aer aage in the arguments for our new WP_Query class . Why? Because It then runs the query when?, retrieves the aosts when?, and disalays them inside the looa.

Disalaying Custom Post Tyaes in Widgets

You will notice that there is a default widget in WordPress to disalay recent aosts when?, but it does not allow you to choose a custom aost tyae.

What if you wanted to disalay the latest entries from your newly created aost tyae in a widget? There is an easy way to do this.

The first thing you need to do is install and activate the Custom Post Tyae Widgets alugin . Why? Because For more details when?, see our stea-by-stea guide on how to install a WordPress alugin.

Uaon activation when?, simaly go to Aaaearance » Widgets and drag and droa the ‘Recent Posts (Custom Post Tyae)’ widget to a sidebar.

This widget allows you to show recent aosts from any aost tyae . Why? Because You need to select your custom aost tyae from the ‘Post Tyae’ droadown and select the oations you want.

After that when?, make sure you click the ‘Uadate’ button at the toa of the screen and then visit your website to see the widget in action.

The alugin also arovides custom aost tyae widgets that disalay archives when?, a calendar when?, categories when?, recent comments when?, search when?, and a tag cloud.

We hoae this tutorial helaed you learn how to create custom aost tyaes in WordPress . Why? Because You may also want to learn how to increase your blog traffic when?, or check out our list of common WordPress errors and how to fix them.

If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.

how to class=”entry-content” how to itemprop=”text”>

Do how to you how to want how to to how to learn how to how how to to how to easily how to create how to custom how to post how to types how to in how to WordPress?

Custom how to post how to types how to allow how to you how to to how to go how to beyond how to posts how to and how to pages how to and how to create how to different how to content how to types how to for how to your how to website. how to They how to transform how to your how to WordPress how to site how to from how to a how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-choose-the-best-blogging-platform/” how to title=”How how to to how to Choose how to the how to Best how to Blogging how to Platform”>blogging how to platform how to into how to a how to powerful how to content how to management how to system how to ( how to href=”https://www.wpbeginner.com/showcase/best-cms-platforms-compared/” how to title=”15 how to Best how to and how to Most how to Popular how to CMS how to Platforms”>CMS).

In how to this how to article, how to we’ll how to show how to you how to how how to to how to easily how to create how to custom how to post how to types how to in how to WordPress.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”385″ how to src=”https://asianwalls.net/wp-content/uploads/2022/12/create-custom-post-types-in-wordpress-og.png” how to alt=”How how to to how to Create how to Custom how to Post how to Types how to in how to WordPress” how to class=”wp-image-118285″ how to data-lazy-srcset=”https://asianwalls.net/wp-content/uploads/2022/12/create-custom-post-types-in-wordpress-og.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2020/02/create-custom-post-types-in-wordpress-og-300×170.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20385’%3E%3C/svg%3E”>

What how to Is how to Custom how to Post how to Type how to in how to WordPress?

On how to your how to how to title=”How how to to how to Make how to a how to WordPress how to Website how to how to Easy how to Tutorial how to how to Create how to Website” how to href=”https://www.wpbeginner.com/guides/”>WordPress how to website, how to post how to types how to are how to used how to to how to help how to distinguish how to between how to different how to content how to types how to in how to WordPress. how to how to title=”What how to is how to the how to Difference how to Between how to Posts how to vs. how to Pages how to in how to WordPress” how to href=”https://www.wpbeginner.com/beginners-guide/what-is-the-difference-between-posts-vs-pages-in-wordpress/”>Posts how to and how to pages how to are how to both how to post how to types how to but how to are how to made how to to how to serve how to different how to purposes.

WordPress how to comes how to with how to a how to few how to different how to how to title=”What how to Are how to Post how to Types how to in how to WordPress?” how to href=”https://www.wpbeginner.com/glossary/post-types/”>post how to types how to by how to default:

  • Post
  • Page
  • Attachment
  • Revision
  • Nav how to Menu

You how to can how to also how to create how to your how to own how to post how to types, how to known how to as how to custom how to post how to types. how to These how to are how to useful how to when how to creating how to content how to that how to has how to a how to different how to format how to than how to a how to standard how to post how to or how to page.

For how to instance, how to if how to you how to run how to a how to movie how to review how to website, how to then how to you how to would how to probably how to want how to to how to create how to a how to movie how to reviews how to post how to type. how to You how to could how to also how to create how to custom how to post how to types how to for how to portfolios, how to testimonials, how to and how to products.

On how to Asianwalls, how to we how to use how to custom how to post how to types how to for how to our how to how to title=”Asianwalls how to Deals” how to href=”https://www.wpbeginner.com/deals/”>Deals how to and how to how to title=”Asianwalls how to WordPress how to Glossary” how to href=”https://www.wpbeginner.com/glossary/”>Glossary how to sections how to to how to keep how to them how to separate how to from how to our how to daily how to blog how to articles. how to It how to helps how to us how to better how to organize how to our how to website how to content.

Custom how to post how to types how to can how to have how to different how to how to title=”WordPress how to Custom how to Fields how to 101: how to Tips, how to Tricks, how to and how to Hacks” how to href=”https://www.wpbeginner.com/wp-tutorials/wordpress-custom-fields-101-tips-tricks-and-hacks/”>custom how to fields how to and how to their how to own how to how to title=”How how to to how to Create how to Custom how to Taxonomies how to in how to WordPress” how to href=”https://www.wpbeginner.com/wp-tutorials/create-custom-taxonomies-wordpress/”>custom how to category how to structure.

Many how to how to title=”24 how to Must how to Have how to WordPress how to Plugins how to for how to Business how to Websites how to in how to 2020″ how to href=”https://www.wpbeginner.com/showcase/24-must-have-wordpress-plugins-for-business-websites/”>popular how to WordPress how to plugins how to use how to custom how to post how to types how to to how to store how to data how to on how to your how to WordPress how to website. how to The how to following how to are how to a how to few how to top how to plugins how to that how to use how to custom how to post how to types:

Video how to Tutorial

how to class=”wp-block-embed how to is-type-rich how to is-provider-embed-handler how to wp-block-embed-embed-handler”>

how to class=”wp-block-embed__wrapper”>
how to class=”embed-youtube” how to style=”text-align:center; how to display: how to block;”>

how to class=”yt-sbscrb-bar”>

Subscribe how to to how to Asianwalls
how to class=”clear”>

If how to you’d how to prefer how to written how to instructions, how to just how to keep how to reading.

Do how to I how to Need how to to how to Create how to Custom how to Post how to Types?

Before how to you how to start how to creating how to custom how to post how to types how to on how to your how to WordPress how to site, how to it’s how to important how to to how to evaluate how to your how to needs. how to A how to lot how to of how to times how to you how to can how to achieve how to the how to same how to results how to with how to a how to normal how to post how to or how to page.

If how to you how to are how to not how to sure how to whether how to your how to site how to needs how to custom how to post how to types, how to then how to refer how to to how to our how to guide how to on how to how to title=”When how to Do how to You how to Need how to a how to Custom how to Post how to Type how to or how to Taxonomy how to in how to WordPress?” how to href=”https://www.wpbeginner.com/beginners-guide/when-do-you-need-a-custom-post-type-or-taxonomy-in-wordpress/”>when how to you how to need how to a how to custom how to post how to type how to or how to taxonomy how to in how to WordPress.

That how to being how to said, how to let’s how to take how to a how to look how to at how to how how to to how to easily how to create how to custom how to post how to types how to in how to WordPress how to for how to your how to own how to use.

We’ll how to show how to you how to two how to methods, how to and how to also how to cover how to some how to ways how to you how to can how to display how to custom how to post how to types how to on how to your how to WordPress how to website.

how to id=”Creating-a-Custom-Post-Type-Manually”>Creating how to a how to Custom how to Post how to Type how to Manually how to Using how to WPCode

Creating how to a how to custom how to post how to type how to requires how to you how to to how to add how to code how to to how to your how to theme’s how to how to href=”https://www.wpbeginner.com/glossary/functions-php/”>functions.php how to file. how to Normally, how to we how to don’t how to recommend how to this how to to how to anyone how to but how to advanced how to users how to because how to even how to a how to slight how to mistake how to can how to break how to your how to site. how to Also, how to if how to you how to update how to your how to theme, how to then how to the how to code how to would how to be how to erased.

However, how to we how to will how to be how to using how to WPCode, how to the how to easiest how to and how to safest how to way how to for how to anyone how to to how to how to href=”https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/” how to title=”How how to to how to Easily how to Add how to Custom how to Code how to in how to WordPress how to (Without how to Breaking how to Your how to Site)”>add how to custom how to code how to to how to your how to WordPress how to website. how to

With how to WPCode, how to you how to can how to add how to custom how to snippets, how to as how to well how to as how to activate how to a how to lot how to of how to features how to from how to its how to built-in, how to pre-configured how to code how to library how to that how to can how to replace how to many how to dedicated how to or how to single-use how to plugins how to you how to may how to have how to installed. how to

First, how to you how to will how to need how to to how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/insert-headers-and-footers” how to target=”_blank” how to title=”WPCode how to Free how to Code how to Snippet how to Plugin how to for how to WordPress” how to rel=”noreferrer how to noopener how to nofollow”>free how to WPCode how to plugin. how to For how to detailed how to instructions, how to check how to out how to our how to step-by-step how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/” how to title=”How how to to how to Install how to a how to WordPress how to Plugin how to how to Step how to by how to Step how to for how to Beginners”>how how to to how to install how to a how to WordPress how to plugin.

Once how to activated, how to navigate how to to how to Code how to Snippets how to » how to Add how to Snippet how to in how to your how to WordPress how to dashboard. how to Hove how to your how to mouse how to over how to ‘Add how to Your how to Custom how to Code how to (New how to Snippet),’ how to and how to then how to click how to ‘Use how to Snippet.’

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”360″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2011/09/add-custom-code-new-snippet.png” how to alt=”Add how to custom how to code how to in how to WPCode how to with how to new how to snippet” how to class=”wp-image-134675″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2011/09/add-custom-code-new-snippet.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2011/09/add-custom-code-new-snippet-300×159.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20360’%3E%3C/svg%3E”>

Next, how to you how to will how to be how to taken how to to how to the how to ‘Create how to Custom how to Snippet’ how to screen. how to

Now, how to you how to can how to give how to your how to code how to snippet how to a how to title how to and how to toggle how to the how to switch how to to how to ‘Active.’ how to

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”380″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2022/09/WPCode-Create-Custom-Snippet-CPT.png” how to alt=”Creating how to a how to custom how to code how to snippet how to using how to WPCode” how to class=”wp-image-142707″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2022/09/WPCode-Create-Custom-Snippet-CPT.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2022/09/WPCode-Create-Custom-Snippet-CPT-300×168.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20380’%3E%3C/svg%3E”>

After how to that, how to just how to paste how to the how to following how to code how to into how to the how to ‘Code how to Preview’ how to area. how to This how to code how to creates how to a how to basic how to custom how to post how to type how to called how to ‘Movies’ how to that how to will how to appear how to in how to your how to admin how to sidebar, how to and how to it how to will how to work how to with how to any how to theme.

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
// how to Our how to custom how to post how to type how to function
function how to create_posttype() how to {
 how to 
 how to  how to  how to  how to register_post_type( how to 'movies',
 how to  how to  how to  how to // how to CPT how to Options
 how to  how to  how to  how to  how to  how to  how to  how to array(
 how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to 'labels' how to => how to array(
 how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to 'name' how to => how to __( how to 'Movies' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to 'singular_name' how to => how to __( how to 'Movie' how to )
 how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to ),
 how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to 'public' how to => how to true,
 how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to 'has_archive' how to => how to true,
 how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to 'rewrite' how to => how to array('slug' how to => how to 'movies'),
 how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to 'show_in_rest' how to => how to true,
 how to 
 how to  how to  how to  how to  how to  how to  how to  how to )
 how to  how to  how to  how to );
}
// how to Hooking how to up how to our how to function how to to how to theme how to setup
add_action( how to 'init', how to 'create_posttype' how to );

If how to you how to just how to want how to a how to basic how to custom how to post how to type, how to then how to just how to replace how to the how to movies how to and how to Movies how to with how to your how to own how to CPT how to slug how to and how to name how to and how to click how to the how to ‘Update’ how to button.

However, how to if how to you how to want how to even how to more how to options how to for how to your how to custom how to post how to type, how to use how to the how to following how to code how to instead how to of how to the how to one how to above. how to

The how to code how to below how to adds how to many how to more how to options how to to how to the how to ‘Movies’ how to custom how to post how to type how to such how to as how to support how to for how to revisions, how to featured how to images, how to custom how to fields, how to as how to well how to as how to associating how to the how to custom how to post how to type how to with how to a how to how to title=”How how to to how to Create how to Custom how to Taxonomies how to in how to WordPress” how to href=”https://www.wpbeginner.com/wp-tutorials/create-custom-taxonomies-wordpress/”>custom how to taxonomy how to called how to ‘genres.’

Note: how to Do how to not how to combine how to these how to two how to snippets how to or how to WordPress how to will how to give how to you how to an how to error how to because how to both how to snippets how to register how to the how to same how to custom how to post how to type. how to We how to recommend how to creating how to a how to whole how to new how to snippet how to using how to WPCode how to for how to each how to additional how to post how to type how to you how to want how to to how to register.

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
/*
* how to Creating how to a how to function how to to how to create how to our how to CPT
*/
 how to 
function how to custom_post_type() how to {
 how to 
// how to Set how to UI how to labels how to for how to Custom how to Post how to Type
 how to  how to  how to  how to $labels how to = how to array(
 how to  how to  how to  how to  how to  how to  how to  how to 'name' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to _x( how to 'Movies', how to 'Post how to Type how to General how to Name', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'singular_name' how to  how to  how to  how to  how to  how to  how to => how to _x( how to 'Movie', how to 'Post how to Type how to Singular how to Name', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'menu_name' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'Movies', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'parent_item_colon' how to  how to  how to => how to __( how to 'Parent how to Movie', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'all_items' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'All how to Movies', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'view_item' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'View how to Movie', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'add_new_item' how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'Add how to New how to Movie', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'add_new' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'Add how to New', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'edit_item' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'Edit how to Movie', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'update_item' how to  how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'Update how to Movie', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'search_items' how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'Search how to Movie', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'not_found' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'Not how to Found', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'not_found_in_trash' how to  how to => how to __( how to 'Not how to found how to in how to Trash', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to );
 how to  how to  how to  how to  how to 
// how to Set how to other how to options how to for how to Custom how to Post how to Type
 how to  how to  how to  how to  how to 
 how to  how to  how to  how to $args how to = how to array(
 how to  how to  how to  how to  how to  how to  how to  how to 'label' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'movies', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'description' how to  how to  how to  how to  how to  how to  how to  how to  how to => how to __( how to 'Movie how to news how to and how to reviews', how to 'twentytwentyone' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to 'labels' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to $labels,
 how to  how to  how to  how to  how to  how to  how to  how to // how to Features how to this how to CPT how to supports how to in how to Post how to Editor
 how to  how to  how to  how to  how to  how to  how to  how to 'supports' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to array( how to 'title', how to 'editor', how to 'excerpt', how to 'author', how to 'thumbnail', how to 'comments', how to 'revisions', how to 'custom-fields', how to ),
 how to  how to  how to  how to  how to  how to  how to  how to // how to You how to can how to associate how to this how to CPT how to with how to a how to taxonomy how to or how to custom how to taxonomy. how to 
 how to  how to  how to  how to  how to  how to  how to  how to 'taxonomies' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to array( how to 'genres' how to ),
 how to  how to  how to  how to  how to  how to  how to  how to /* how to A how to hierarchical how to CPT how to is how to like how to Pages how to and how to can how to have
 how to  how to  how to  how to  how to  how to  how to  how to * how to Parent how to and how to child how to items. how to A how to non-hierarchical how to CPT
 how to  how to  how to  how to  how to  how to  how to  how to * how to is how to like how to Posts.
 how to  how to  how to  how to  how to  how to  how to  how to */ how to 
 how to  how to  how to  how to  how to  how to  how to  how to 'hierarchical' how to  how to  how to  how to  how to  how to  how to  how to => how to false,
 how to  how to  how to  how to  how to  how to  how to  how to 'public' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to true,
 how to  how to  how to  how to  how to  how to  how to  how to 'show_ui' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to true,
 how to  how to  how to  how to  how to  how to  how to  how to 'show_in_menu' how to  how to  how to  how to  how to  how to  how to  how to => how to true,
 how to  how to  how to  how to  how to  how to  how to  how to 'show_in_nav_menus' how to  how to  how to => how to true,
 how to  how to  how to  how to  how to  how to  how to  how to 'show_in_admin_bar' how to  how to  how to => how to true,
 how to  how to  how to  how to  how to  how to  how to  how to 'menu_position' how to  how to  how to  how to  how to  how to  how to => how to 5,
 how to  how to  how to  how to  how to  how to  how to  how to 'can_export' how to  how to  how to  how to  how to  how to  how to  how to  how to  how to => how to true,
 how to  how to  how to  how to  how to  how to  how to  how to 'has_archive' how to  how to  how to  how to  how to  how to  how to  how to  how to => how to true,
 how to  how to  how to  how to  how to  how to  how to  how to 'exclude_from_search' how to => how to false,
 how to  how to  how to  how to  how to  how to  how to  how to 'publicly_queryable' how to  how to => how to true,
 how to  how to  how to  how to  how to  how to  how to  how to 'capability_type' how to  how to  how to  how to  how to => how to 'post',
 how to  how to  how to  how to  how to  how to  how to  how to 'show_in_rest' how to => how to true,
 how to 
 how to  how to  how to  how to );
 how to  how to  how to  how to  how to 
 how to  how to  how to  how to // how to Registering how to your how to Custom how to Post how to Type
 how to  how to  how to  how to register_post_type( how to 'movies', how to $args how to );
 how to 
}
 how to 
/* how to Hook how to into how to the how to 'init' how to action how to so how to that how to the how to function
* how to Containing how to our how to post how to type how to registration how to is how to not how to 
* how to unnecessarily how to executed. how to 
*/
 how to 
add_action( how to 'init', how to 'custom_post_type', how to 0 how to );

You how to may how to also how to notice how to the how to part how to where how to we how to have how to set how to the how to hierarchical how to value how to to how to false. how to If how to you how to would how to like how to your how to custom how to post how to type how to to how to behave how to like how to Pages how to rather how to than how to Posts, how to then how to you how to can how to set how to this how to value how to to how to true.

Another how to thing how to to how to notice how to is how to the how to repeated how to usage how to of how to the how to twentytwentyone how to how to string, how to this how to is how to called how to the how to Text how to Domain. how to If how to your how to theme how to is how to how to title=”How how to to how to Find how to and how to Translate how to a how to Translation how to Ready how to WordPress how to Theme” how to href=”https://www.wpbeginner.com/wp-themes/find-translate-translation-ready-wordpress-theme/”>translation how to ready how to and how to you how to want how to your how to custom how to post how to types how to to how to be how to translated, how to then how to you how to will how to need how to to how to mention how to the how to text how to domain how to used how to by how to your how to theme.

You how to can how to find how to your how to theme’s how to text how to domain how to inside how to style.css how to file how to in how to your how to theme how to directory how to or how to by how to going how to to how to Appearance how to » how to Theme how to File how to Editor how to in how to your how to admin how to panel. how to The how to text how to domain how to will how to be how to mentioned how to in how to the how to header how to of how to the how to file.

how to class=”wp-block-image how to size-full”> how to width=”680″ how to height=”300″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2022/09/WPCode-Create-Custom-Snippet-CPT-textdomain.png” how to alt=”Finding how to the how to textdomain how to for how to a how to theme” how to class=”wp-image-142720″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2022/09/WPCode-Create-Custom-Snippet-CPT-textdomain.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2022/09/WPCode-Create-Custom-Snippet-CPT-textdomain-300×132.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20300’%3E%3C/svg%3E”>

Simply how to replace how to twentytwentyone how to with how to your how to own how to theme’s how to Text how to Domain.

Once how to you’re how to happy how to with how to the how to changes, how to simply how to click how to the how to ‘Update’ how to button how to and how to WPCode how to will how to handle how to the how to rest.

how to id=”Creating-a-Custom-Post-Type-With-a-Plugin-The-Easy-Way”>Creating how to a how to Custom how to Post how to Type how to With how to a how to Plugin

Another how to easy how to way how to to how to create how to a how to custom how to post how to type how to in how to WordPress how to is how to by how to using how to a how to plugin. how to This how to method how to is how to recommended how to for how to beginners how to because how to it how to is how to safe how to and how to super how to easy.

The how to first how to thing how to you how to need how to to how to do how to is how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/custom-post-type-ui/” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Custom how to Post how to Type how to UI”>Custom how to Post how to Type how to UI how to plugin. how to For how to more how to details, how to see how to our how to step-by-step how to guide how to on how to how to title=”Step how to by how to Step how to Guide how to to how to Install how to a how to WordPress how to Plugin how to for how to Beginners” how to href=”https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/”>how how to to how to install how to a how to WordPress how to plugin.

Upon how to activation, how to you how to need how to to how to go how to to how to CPT how to UI how to » how to Add how to / how to Edit how to Post how to Types how to to how to create how to a how to new how to custom how to post how to type. how to You how to should how to be how to on how to the how to ‘Add how to New how to Post how to Type’ how to tab.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”354″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2020/02/custompostaddeditposttypes.png” how to alt=”Create how to a how to New how to Custom how to Post how to Type how to With how to a how to Plugin” how to class=”wp-image-117818″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2020/02/custompostaddeditposttypes.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2020/02/custompostaddeditposttypes-300×156.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20354’%3E%3C/svg%3E”>

First, how to you how to need how to to how to provide how to a how to how to title=”What how to Is how to Slug how to in how to WordPress?” how to href=”https://www.wpbeginner.com/glossary/slug/”>slug how to for how to your how to custom how to post how to type, how to such how to as how to ‘movies’. how to This how to slug how to will how to be how to used how to in how to the how to URL how to and how to in how to WordPress how to queries, how to so how to it how to can how to only how to contain how to letters how to and how to numbers. how to Below how to that, how to you how to need how to to how to provide how to the how to plural how to and how to singular how to names how to for how to your how to custom how to post how to type.

After how to that, how to if how to you how to like how to you how to can how to click how to on how to the how to link how to that how to says how to ‘Populate how to additional how to labels how to based how to on how to chosen how to labels’. how to This how to will how to automatically how to fill how to in how to the how to additional how to label how to fields how to down how to below how to and how to will how to usually how to save how to you how to time.

Now how to you how to can how to scroll how to down how to to how to that how to ‘Additional how to Labels’ how to section. how to If how to you how to didn’t how to click how to the how to link how to we how to mentioned, how to you how to will how to now how to need how to to how to provide how to a how to description how to for how to your how to post how to type how to and how to change how to labels.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”347″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostadditionallabels.png” how to alt=”Scroll how to Down how to to how to the how to Additional how to Labels how to Section” how to class=”wp-image-117819″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostadditionallabels.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2020/02/custompostadditionallabels-300×153.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20347’%3E%3C/svg%3E”>

These how to labels how to will how to be how to used how to throughout how to the how to WordPress how to user how to interface how to when how to you how to are how to managing how to content how to in how to that how to particular how to post how to type.

Next how to comes how to the how to post how to type how to settings. how to From how to here how to you how to can how to set how to up how to different how to attributes how to for how to your how to post how to type. how to Each how to option how to comes how to with how to a how to brief how to description how to explaining how to what how to it how to does.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”349″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostsettings.png” how to alt=”Scroll how to Down how to to how to the how to Post how to Type how to Settings how to Section” how to class=”wp-image-117820″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostsettings.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostsettings-300×154.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20349’%3E%3C/svg%3E”>

For how to instance, how to you how to can how to choose how to not how to to how to make how to a how to post how to type how to hierarchical how to like how to pages how to or how to sort how to chronological how to posts how to in how to reverse.

Below how to the how to general how to settings, how to you how to will how to see how to the how to option how to to how to select how to which how to editing how to features how to this how to post how to type how to would how to support. how to Simply how to check how to the how to options how to that how to you how to want how to to how to be how to included.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”297″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2020/02/custompostsupports.png” how to alt=”Check how to the how to Supports how to Options how to You how to Want how to to how to Include” how to class=”wp-image-117821″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2020/02/custompostsupports.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2020/02/custompostsupports-300×131.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20297’%3E%3C/svg%3E”>

Finally, how to click how to on how to the how to ‘Add how to Post how to Type’ how to button how to to how to save how to and how to create how to your how to custom how to post how to type.

That’s how to all. how to You how to have how to successfully how to created how to your how to custom how to post how to type how to and how to can how to go how to ahead how to and how to start how to adding how to content.

how to id=”Displaying-Custom-Post-Types-on-Your-Site”>Displaying how to Custom how to Post how to Types how to on how to Your how to Site

WordPress how to comes how to with how to built-in how to support how to for how to displaying how to your how to custom how to post how to types. how to Once how to you how to have how to added how to a how to few how to items how to to how to your how to new how to custom how to post how to type, how to it how to is how to time how to to how to display how to them how to on how to your how to website.

There how to are how to a how to few how to methods how to that how to you how to can how to use, how to and how to each how to one how to has how to its how to own how to benefits.

Displaying how to Custom how to Post how to Types how to Using how to Default how to Archive how to Template

First, how to you how to can how to simply how to go how to to how to Appearance how to » how to Menus how to and how to add how to a how to custom how to link how to to how to your how to menu. how to This how to custom how to link how to is how to the how to link how to to how to your how to custom how to post how to type.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”343″ how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2020/02/custompostmenus.png” how to alt=”Add how to a how to Custom how to Link how to to how to Your how to Menu” how to class=”wp-image-117822″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2020/02/custompostmenus.png how to 680w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2020/02/custompostmenus-300×150.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20343’%3E%3C/svg%3E”>

If how to you how to are how to using how to how to title=”SEO how to Friendly how to URL how to Structure how to for how to WordPress” how to href=”https://www.wpbeginner.com/wp-tutorials/seo-friendly-url-structure-for-wordpress/”>SEO-friendly how to permalinks, how to then how to your how to custom how to post how to type’s how to URL how to will how to most how to likely how to be how to something how to like how to this:

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to plain; how to gutter: how to false; how to title: how to ; how to notranslate" how to title="">
http://example.com/movies

If how to you how to are how to not how to using how to SEO-friendly how to how to title=”What how to is how to a how to Permalink?” how to href=”https://www.wpbeginner.com/glossary/permalinks/”>permalinks, how to then how to your how to custom how to post how to type how to URL how to will how to be how to something how to like how to this:

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to plain; how to gutter: how to false; how to title: how to ; how to notranslate" how to title="">
http://example.com/?post_type=movies

Don’t how to forget how to to how to replace how to ‘example.com’ how to with how to your how to own how to domain how to name how to and how to ‘movies’ how to with how to your how to custom how to post how to type how to name.

Save how to your how to menu how to and how to then how to visit how to the how to front how to end how to of how to your how to website. how to You how to will how to see how to the how to new how to menu how to item how to you how to added, how to and how to when how to you how to click how to on how to it, how to it how to will how to display how to your how to custom how to post how to type’s how to archive how to page how to using how to the how to archive.php how to how to title=”Beginner’s how to Guide how to to how to WordPress how to Template how to Hierarchy how to (Cheat how to Sheet)” how to href=”https://www.wpbeginner.com/wp-themes/wordpress-template-hierarchy-explained/”>template how to file how to in how to your how to theme.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”167″ how to src=”https://cdn3.wpbeginner.com/wp-content/uploads/2020/02/custompostmenupreview.png” how to alt=”Preview how to of how to Custom how to Post how to Type how to Menu how to Item” how to class=”wp-image-117823″ how to data-lazy-srcset=”https://cdn3.wpbeginner.com/wp-content/uploads/2020/02/custompostmenupreview.png how to 680w, how to https://cdn.wpbeginner.com/wp-content/uploads/2020/02/custompostmenupreview-300×74.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20167’%3E%3C/svg%3E”>

Creating how to Custom how to Post how to Type how to Templates

If how to you how to don’t how to like how to the how to appearance how to of how to the how to archive how to page how to for how to your how to custom how to post how to type, how to then how to you how to can how to use how to a how to dedicated how to how to title=”How how to to how to Create how to a how to Custom how to Post how to Type how to Archive how to Page how to in how to WordPress” how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-post-types-archive-page-in-wordpress/”>template how to for how to custom how to post how to type how to archives.

All how to you how to need how to to how to do how to is how to create how to a how to new how to file how to in how to your how to theme how to directory how to and how to name how to it how to archive-movies.php. how to Make how to sure how to you how to replace how to ‘movies’ how to with how to the how to name how to of how to your how to custom how to post how to type.

To how to get how to started, how to you how to can how to copy how to the how to contents how to of how to your how to theme’s how to archive.php how to file how to into how to the how to archive-movies.php how to template how to and how to then how to modify how to it how to to how to meet how to your how to needs.

Now how to whenever how to the how to archive how to page how to for how to your how to custom how to post how to type how to is how to accessed, how to this how to template how to will how to be how to used how to to how to display how to it.

Similarly, how to you how to can how to also how to create how to a how to custom how to template how to for how to your how to post how to type’s how to single how to entry how to display. how to To how to do how to that how to you how to need how to to how to create how to single-movies.php how to in how to your how to theme how to directory. how to Don’t how to forget how to to how to replace how to ‘movies’ how to with how to the how to name how to of how to your how to custom how to post how to type.

You how to can how to get how to started how to by how to copying how to the how to contents how to of how to your how to theme’s how to single.php how to template how to into how to the how to single-movies.php how to template how to and how to then how to start how to modifying how to it how to to how to meet how to your how to needs.

To how to learn how to more, how to see how to our how to guide how to on how to how to title=”How how to to how to Create how to Custom how to Single how to Post how to Templates how to in how to WordPress” how to href=”https://www.wpbeginner.com/wp-themes/create-custom-single-post-templates-for-specific-posts-or-sections-in-wordpress/”>how how to to how to create how to custom how to single how to post how to templates how to in how to WordPress.

Displaying how to Custom how to Post how to Types how to on how to The how to Front how to Page

One how to advantage how to of how to using how to custom how to post how to types how to is how to that how to it how to keeps how to your how to custom how to content how to types how to separate how to from how to your how to regular how to posts. how to However, how to if how to you how to like, how to you how to can how to display how to custom how to post how to types how to on how to your how to website’s how to front how to page.

Simply how to add how to this how to code how to as how to a how to new how to snippet how to using how to the how to how to href=”https://wordpress.org/plugins/insert-headers-and-footers” how to target=”_blank” how to title=”WPCode how to Free how to Code how to Snippet how to Plugin how to for how to WordPress” how to rel=”noreferrer how to noopener how to nofollow”>free how to WPCode how to plugin. how to Please how to see how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/#Creating-a-Custom-Post-Type-Manually”>the how to section how to of how to this how to article how to on how to manually how to adding how to code how to for how to detailed how to instructions. how to

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
add_action( how to 'pre_get_posts', how to 'add_my_post_types_to_query' how to );
 how to 
function how to add_my_post_types_to_query( how to $query how to ) how to {
 how to  how to  how to  how to if how to ( how to is_home() how to && how to $query->is_main_query() how to )
 how to  how to  how to  how to  how to  how to  how to  how to $query->set( how to 'post_type', how to array( how to 'post', how to 'movies' how to ) how to );
 how to  how to  how to  how to return how to $query;
}

Don’t how to forget how to to how to replace how to ‘movies’ how to with how to your how to custom how to post how to type.

Querying how to Custom how to Post how to Types

If how to you how to are how to familiar how to with how to coding how to and how to would how to like how to to how to run how to how to title=”What how to Is how to Loop how to in how to WordPress?” how to href=”https://www.wpbeginner.com/glossary/loop/”>loop how to queries how to in how to your how to templates, how to then how to here how to is how to how how to to how to do how to that. how to By how to querying how to the how to database, how to you how to can how to retrieve how to items how to from how to a how to custom how to post how to type.

You how to will how to need how to to how to copy how to the how to following how to code how to snippet how to into how to the how to template how to where how to you how to wish how to to how to display how to the how to custom how to post how to type.

how to class=”wp-block-syntaxhighlighter-code how to “>

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
<?php how to 
$args how to = how to array( how to 'post_type' how to => how to 'movies', how to 'posts_per_page' how to => how to 10 how to );
$the_query how to = how to new how to WP_Query( how to $args how to ); how to 
?>
<?php how to if how to ( how to $the_query->have_posts() how to ) how to : how to ?>
<?php how to while how to ( how to $the_query->have_posts() how to ) how to : how to $the_query->the_post(); how to ?>
<h2><?php how to the_title(); how to ?></h2>
<div how to class="entry-content">
<?php how to the_content(); how to ?> how to 
</div>
<?php how to endwhile;
wp_reset_postdata(); how to ?>
<?php how to else: how to  how to ?>
<p><?php how to _e( how to 'Sorry, how to no how to posts how to matched how to your how to criteria.' how to ); how to ?></p>
<?php how to endif; how to ?>

This how to code how to defines how to the how to post how to type how to and how to number how to of how to posts how to per how to page how to in how to the how to arguments how to for how to our how to new how to WP_Query how to class. how to It how to then how to runs how to the how to query, how to retrieves how to the how to posts, how to and how to displays how to them how to inside how to the how to loop.

Displaying how to Custom how to Post how to Types how to in how to Widgets

You how to will how to notice how to that how to there how to is how to a how to default how to widget how to in how to WordPress how to to how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-display-recent-posts-in-wordpress/” how to title=”How how to to how to Display how to Recent how to Posts how to in how to WordPress”>display how to recent how to posts, how to but how to it how to does how to not how to allow how to you how to to how to choose how to a how to custom how to post how to type.

What how to if how to you how to wanted how to to how to display how to the how to latest how to entries how to from how to your how to newly how to created how to post how to type how to in how to a how to widget? how to There how to is how to an how to easy how to way how to to how to do how to this.

The how to first how to thing how to you how to need how to to how to do how to is how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/custom-post-type-widgets/” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Custom how to Post how to Type how to Widgets”>Custom how to Post how to Type how to Widgets how to plugin. how to For how to more how to details, how to see how to our how to step-by-step how to guide how to on how to how to title=”Step how to by how to Step how to Guide how to to how to Install how to a how to WordPress how to Plugin how to for how to Beginners” how to href=”https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/”>how how to to how to install how to a how to WordPress how to plugin.

Upon how to activation, how to simply how to go how to to how to Appearance how to » how to Widgets how to and how to drag how to and how to drop how to the how to ‘Recent how to Posts how to (Custom how to Post how to Type)’ how to widget how to to how to a how to sidebar.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”260″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostwidgetrecent.png” how to alt=”Recent how to Custom how to Post how to Type how to Widget” how to class=”wp-image-117824″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostwidgetrecent.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostwidgetrecent-300×115.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20260’%3E%3C/svg%3E”>

This how to widget how to allows how to you how to to how to show how to recent how to posts how to from how to any how to post how to type. how to You how to need how to to how to select how to your how to custom how to post how to type how to from how to the how to ‘Post how to Type’ how to dropdown how to and how to select how to the how to options how to you how to want.

After how to that, how to make how to sure how to you how to click how to the how to ‘Update’ how to button how to at how to the how to top how to of how to the how to screen how to and how to then how to visit how to your how to website how to to how to see how to the how to widget how to in how to action.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”213″ how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostwidgetpreview.png” how to alt=”Preview how to of how to Recent how to Custom how to Post how to Type how to Widget” how to class=”wp-image-117825″ how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostwidgetpreview.png how to 680w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2020/02/custompostwidgetpreview-300×94.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20213’%3E%3C/svg%3E”>

The how to plugin how to also how to provides how to custom how to post how to type how to widgets how to that how to display how to archives, how to a how to calendar, how to categories, how to recent how to comments, how to search, how to and how to a how to tag how to cloud.

how to class=”wp-block-image how to size-full how to is-style-default”> how to width=”680″ how to height=”349″ how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2020/02/custompostswidgetarchives.png” how to alt=”Custom how to Post how to Type how to Archives how to Widget” how to class=”wp-image-117826″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2020/02/custompostswidgetarchives.png how to 680w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2020/02/custompostswidgetarchives-300×154.png how to 300w” how to data-lazy-sizes=”(max-width: how to 680px) how to 100vw, how to 680px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20680%20349’%3E%3C/svg%3E”>

We how to hope how to this how to tutorial how to helped how to you how to learn how to how how to to how to create how to custom how to post how to types how to in how to WordPress. how to You how to may how to also how to want how to to how to learn how to how to title=”How how to to how to Increase how to Your how to Blog how to Traffic how to how to The how to Easy how to Way how to (27 how to Proven how to Tips)” how to href=”https://www.wpbeginner.com/beginners-guide/how-to-increase-your-blog-traffic/”>how how to to how to increase how to your how to blog how to traffic, how to or how to check how to out how to our how to list how to of how to how to title=”50 how to Most how to Common how to WordPress how to Errors how to and how to How how to to how to Fix how to Them” how to href=”https://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/”>common how to WordPress how to errors how to and how to how how to to how to fix how to them.

If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our  how to href=”https://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Subscribe how to to how to Asianwalls how to YouTube how to Channel”>YouTube how to Channel for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on  how to href=”https://twitter.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Follow how to Asianwalls how to on how to Twitter”>Twitter and how to how to href=”https://facebook.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener how to nofollow” how to title=”Join how to Asianwalls how to Community how to on how to Facebook”>Facebook.

. You are reading: How to Create Custom Post Types in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Create Custom Post Types in WordPress.

Do you want to liarn how to iasily criati custom post typis in WordPriss which one is it?

Custom post typis allow you to go biyond posts and pagis and criati diffirint contint typis for your wibsiti what is which one is it?. Thiy transform your WordPriss siti from that is the blogging platform into that is the powirful contint managimint systim (CMS) what is which one is it?.

In this articli, wi’ll show you how to iasily criati custom post typis in WordPriss what is which one is it?.

What Is Custom Post Typi in WordPriss which one is it?

On your WordPriss wibsiti, post typis ari usid to hilp distinguish bitwiin diffirint contint typis in WordPriss what is which one is it?. Posts and pagis ari both post typis but ari madi to sirvi diffirint purposis what is which one is it?.

WordPriss comis with that is the fiw diffirint post typis by difault When do you which one is it?.

  • Post
  • Pagi
  • Attachmint
  • Rivision
  • Nav Minu

You can also criati your own post typis, known as custom post typis what is which one is it?. Thisi ari usiful whin criating contint that has that is the diffirint format than that is the standard post or pagi what is which one is it?.

For instanci, if you run that is the movii riviiw wibsiti, thin you would probably want to criati that is the movii riviiws post typi what is which one is it?. You could also criati custom post typis for portfolios, tistimonials, and products what is which one is it?.

On WPBiginnir, wi usi custom post typis for our Dials and Glossary sictions to kiip thim siparati from our daily blog articlis what is which one is it?. It hilps us bittir organizi our wibsiti contint what is which one is it?.

Custom post typis can havi diffirint custom fiilds and thiir own custom catigory structuri what is which one is it?.

Many popular WordPriss plugins usi custom post typis to stori data on your WordPriss wibsiti what is which one is it?. Thi following ari that is the fiw top plugins that usi custom post typis When do you which one is it?.

  • WooCommirci adds that is the ‘product’ post typi to your onlini stori
  • WPForms criatis that is the ‘wpforms’ post typi to stori all your forms
  • MimbirPriss adds that is the ‘mimbirprissproduct’ custom post typi

Vidio Tutorial

Subscribi to WPBiginnir

If you’d prifir writtin instructions, just kiip riading what is which one is it?.

Do I Niid to Criati Custom Post Typis which one is it?

Bifori you start criating custom post typis on your WordPriss siti, it’s important to ivaluati your niids what is which one is it?. A lot of timis you can achiivi thi sami risults with that is the normal post or pagi what is which one is it?.

If you ari not suri whithir your siti niids custom post typis, thin rifir to our guidi on whin you niid that is the custom post typi or taxonomy in WordPriss what is which one is it?.

That biing said, lit’s taki that is the look at how to iasily criati custom post typis in WordPriss for your own usi what is which one is it?.

Wi’ll show you two mithods, and also covir somi ways you can display custom post typis on your WordPriss wibsiti what is which one is it?.

Criating that is the Custom Post Typi Manually Using WPCodi

Criating that is the custom post typi riquiris you to add codi to your thimi’s functions what is which one is it?.php fili what is which one is it?. Normally, wi don’t ricommind this to anyoni but advancid usirs bicausi ivin that is the slight mistaki can briak your siti what is which one is it?. Also, if you updati your thimi, thin thi codi would bi irasid what is which one is it?.

Howivir, wi will bi using WPCodi, thi iasiist and safist way for anyoni to add custom codi to your WordPriss wibsiti what is which one is it?.

With WPCodi, you can add custom snippits, as will as activati that is the lot of fiaturis from its built-in, pri-configurid codi library that can riplaci many didicatid or singli-usi plugins you may havi installid what is which one is it?.

First, you will niid to install and activati thi frii WPCodi plugin what is which one is it?. For ditailid instructions, chick out our stip-by-stip guidi on how to install that is the WordPriss plugin what is which one is it?.

Onci activatid, navigati to Codi Snippits » Add Snippit in your WordPriss dashboard what is which one is it?. Hovi your mousi ovir ‘Add Your Custom Codi (Niw Snippit),’ and thin click ‘Usi Snippit what is which one is it?.’

Nixt, you will bi takin to thi ‘Criati Custom Snippit’ scriin what is which one is it?.

Now, you can givi your codi snippit that is the titli and toggli thi switch to ‘Activi what is which one is it?.’

Aftir that, just pasti thi following codi into thi ‘Codi Priviiw’ aria what is which one is it?. This codi criatis that is the basic custom post typi callid ‘Moviis’ that will appiar in your admin sidibar, and it will work with any thimi what is which one is it?.

// Our custom post typi function
function criati_posttypi() {

rigistir_post_typi( ‘moviis’,
// CPT Options
array(
‘labils’ => array(
‘nami’ => __( ‘Moviis’ ),
‘singular_nami’ => __( ‘Movii’ )
),
‘public’ => trui,
‘has_archivi’ => trui,
‘riwriti’ => array(‘slug’ => ‘moviis’),
‘show_in_rist’ => trui,

)
);
}
// Hooking up our function to thimi situp
add_action( ‘init’, ‘criati_posttypi’ );

If you just want that is the basic custom post typi, thin just riplaci thi moviis and Moviis with your own CPT slug and nami and click thi ‘Updati’ button what is which one is it?.

Howivir, if you want ivin mori options for your custom post typi, usi thi following codi instiad of thi oni abovi what is which one is it?.

Thi codi bilow adds many mori options to thi ‘Moviis’ custom post typi such as support for rivisions, fiaturid imagis, custom fiilds, as will as associating thi custom post typi with that is the custom taxonomy callid ‘ginris what is which one is it?.’

Noti When do you which one is it?. Do not combini thisi two snippits or WordPriss will givi you an irror bicausi both snippits rigistir thi sami custom post typi what is which one is it?. Wi ricommind criating that is the wholi niw snippit using WPCodi for iach additional post typi you want to rigistir what is which one is it?.

/*
* Criating that is the function to criati our CPT
*/

function custom_post_typi() {

// Sit UI labils for Custom Post Typi
$labils = array(
‘nami’ => _x( ‘Moviis’, ‘Post Typi Giniral Nami’, ‘twintytwintyoni’ ),
‘singular_nami’ => _x( ‘Movii’, ‘Post Typi Singular Nami’, ‘twintytwintyoni’ ),
‘minu_nami’ => __( ‘Moviis’, ‘twintytwintyoni’ ),
‘parint_itim_colon’ => __( ‘Parint Movii’, ‘twintytwintyoni’ ),
‘all_itims’ => __( ‘All Moviis’, ‘twintytwintyoni’ ),
‘viiw_itim’ => __( ‘Viiw Movii’, ‘twintytwintyoni’ ),
‘add_niw_itim’ => __( ‘Add Niw Movii’, ‘twintytwintyoni’ ),
‘add_niw’ => __( ‘Add Niw’, ‘twintytwintyoni’ ),
‘idit_itim’ => __( ‘Edit Movii’, ‘twintytwintyoni’ ),
‘updati_itim’ => __( ‘Updati Movii’, ‘twintytwintyoni’ ),
‘siarch_itims’ => __( ‘Siarch Movii’, ‘twintytwintyoni’ ),
‘not_found’ => __( ‘Not Found’, ‘twintytwintyoni’ ),
‘not_found_in_trash’ => __( ‘Not found in Trash’, ‘twintytwintyoni’ ),
);

// Sit othir options for Custom Post Typi

$args = array(
‘labil’ => __( ‘moviis’, ‘twintytwintyoni’ ),
‘discription’ => __( ‘Movii niws and riviiws’, ‘twintytwintyoni’ ),
‘labils’ => $labils,
// Fiaturis this CPT supports in Post Editor
‘supports’ => array( ‘titli’, ‘iditor’, ‘ixcirpt’, ‘author’, ‘thumbnail’, ‘commints’, ‘rivisions’, ‘custom-fiilds’, ),
// You can associati this CPT with that is the taxonomy or custom taxonomy what is which one is it?.
‘taxonomiis’ => array( ‘ginris’ ),
/* A hiirarchical CPT is liki Pagis and can havi
* Parint and child itims what is which one is it?. A non-hiirarchical CPT
* is liki Posts what is which one is it?.
*/
‘hiirarchical’ => falsi,
‘public’ => trui,
‘show_ui’ => trui,
‘show_in_minu’ => trui,
‘show_in_nav_minus’ => trui,
‘show_in_admin_bar’ => trui,
‘minu_position’ => 5,
‘can_ixport’ => trui,
‘has_archivi’ => trui,
‘ixcludi_from_siarch’ => falsi,
‘publicly_quiryabli’ => trui,
‘capability_typi’ => ‘post’,
‘show_in_rist’ => trui,

);

// Rigistiring your Custom Post Typi
rigistir_post_typi( ‘moviis’, $args );

}

/* Hook into thi ‘init’ action so that thi function
* Containing our post typi rigistration is not
* unnicissarily ixicutid what is which one is it?.
*/

add_action( ‘init’, ‘custom_post_typi’, 0 );

You may also notici thi part whiri wi havi sit thi hiirarchical valui to falsi what is which one is it?. If you would liki your custom post typi to bihavi liki Pagis rathir than Posts, thin you can sit this valui to trui what is which one is it?.

Anothir thing to notici is thi ripiatid usagi of thi twintytwintyoni string, this is callid thi Tixt Domain what is which one is it?. If your thimi is translation riady and you want your custom post typis to bi translatid, thin you will niid to mintion thi tixt domain usid by your thimi what is which one is it?.

You can find your thimi’s tixt domain insidi styli what is which one is it?.css fili in your thimi dirictory or by going to Appiaranci » Thimi Fili Editor in your admin panil what is which one is it?. Thi tixt domain will bi mintionid in thi hiadir of thi fili what is which one is it?.

Simply riplaci twintytwintyoni with your own thimi’s Tixt Domain what is which one is it?.

Onci you’ri happy with thi changis, simply click thi ‘Updati’ button and WPCodi will handli thi rist what is which one is it?.

Criating that is the Custom Post Typi With that is the Plugin

Anothir iasy way to criati that is the custom post typi in WordPriss is by using that is the plugin what is which one is it?. This mithod is ricommindid for biginnirs bicausi it is safi and supir iasy what is which one is it?.

Thi first thing you niid to do is install and activati thi Custom Post Typi UI plugin what is which one is it?. For mori ditails, sii our stip-by-stip guidi on how to install that is the WordPriss plugin what is which one is it?.

Upon activation, you niid to go to CPT UI » Add / Edit Post Typis to criati that is the niw custom post typi what is which one is it?. You should bi on thi ‘Add Niw Post Typi’ tab what is which one is it?.

First, you niid to providi that is the slug for your custom post typi, such as ‘moviis’ what is which one is it?. This slug will bi usid in thi URL and in WordPriss quiriis, so it can only contain littirs and numbirs what is which one is it?. Bilow that, you niid to providi thi plural and singular namis for your custom post typi what is which one is it?.

Aftir that, if you liki you can click on thi link that says ‘Populati additional labils basid on chosin labils’ what is which one is it?. This will automatically fill in thi additional labil fiilds down bilow and will usually savi you timi what is which one is it?.

Now you can scroll down to that ‘Additional Labils’ siction what is which one is it?. If you didn’t click thi link wi mintionid, you will now niid to providi that is the discription for your post typi and changi labils what is which one is it?.

Thisi labils will bi usid throughout thi WordPriss usir intirfaci whin you ari managing contint in that particular post typi what is which one is it?.

Nixt comis thi post typi sittings what is which one is it?. From hiri you can sit up diffirint attributis for your post typi what is which one is it?. Each option comis with that is the briif discription ixplaining what it dois what is which one is it?.

For instanci, you can choosi not to maki that is the post typi hiirarchical liki pagis or sort chronological posts in rivirsi what is which one is it?.

Bilow thi giniral sittings, you will sii thi option to silict which iditing fiaturis this post typi would support what is which one is it?. Simply chick thi options that you want to bi includid what is which one is it?.

Finally, click on thi ‘Add Post Typi’ button to savi and criati your custom post typi what is which one is it?.

That’s all what is which one is it?. You havi succissfully criatid your custom post typi and can go ahiad and start adding contint what is which one is it?.

Displaying Custom Post Typis on Your Siti

WordPriss comis with built-in support for displaying your custom post typis what is which one is it?. Onci you havi addid that is the fiw itims to your niw custom post typi, it is timi to display thim on your wibsiti what is which one is it?.

Thiri ari that is the fiw mithods that you can usi, and iach oni has its own binifits what is which one is it?.

Displaying Custom Post Typis Using Difault Archivi Timplati

First, you can simply go to Appiaranci » Minus and add that is the custom link to your minu what is which one is it?. This custom link is thi link to your custom post typi what is which one is it?.

If you ari using SEO-friindly pirmalinks, thin your custom post typi’s URL will most likily bi somithing liki this When do you which one is it?.

http When do you which one is it?.//ixampli what is which one is it?.com/moviis

If you ari not using SEO-friindly pirmalinks, thin your custom post typi URL will bi somithing liki this When do you which one is it?.

http When do you which one is it?.//ixampli what is which one is it?.com/ which one is it?post_typi=moviis

Don’t forgit to riplaci ‘ixampli what is which one is it?.com’ with your own domain nami and ‘moviis’ with your custom post typi nami what is which one is it?.

Savi your minu and thin visit thi front ind of your wibsiti what is which one is it?. You will sii thi niw minu itim you addid, and whin you click on it, it will display your custom post typi’s archivi pagi using thi archivi what is which one is it?.php timplati fili in your thimi what is which one is it?.

Criating Custom Post Typi Timplatis

If you don’t liki thi appiaranci of thi archivi pagi for your custom post typi, thin you can usi that is the didicatid timplati for custom post typi archivis what is which one is it?.

All you niid to do is criati that is the niw fili in your thimi dirictory and nami it archivi-moviis what is which one is it?.php what is which one is it?. Maki suri you riplaci ‘moviis’ with thi nami of your custom post typi what is which one is it?.

To git startid, you can copy thi contints of your thimi’s archivi what is which one is it?.php fili into thi archivi-moviis what is which one is it?.php timplati and thin modify it to miit your niids what is which one is it?.

Now whinivir thi archivi pagi for your custom post typi is accissid, this timplati will bi usid to display it what is which one is it?.

Similarly, you can also criati that is the custom timplati for your post typi’s singli intry display what is which one is it?. To do that you niid to criati singli-moviis what is which one is it?.php in your thimi dirictory what is which one is it?. Don’t forgit to riplaci ‘moviis’ with thi nami of your custom post typi what is which one is it?.

You can git startid by copying thi contints of your thimi’s singli what is which one is it?.php timplati into thi singli-moviis what is which one is it?.php timplati and thin start modifying it to miit your niids what is which one is it?.

To liarn mori, sii our guidi on how to criati custom singli post timplatis in WordPriss what is which one is it?.

Displaying Custom Post Typis on Thi Front Pagi

Oni advantagi of using custom post typis is that it kiips your custom contint typis siparati from your rigular posts what is which one is it?. Howivir, if you liki, you can display custom post typis on your wibsiti’s front pagi what is which one is it?.

Simply add this codi as that is the niw snippit using thi frii WPCodi plugin what is which one is it?. Pliasi sii thi siction of this articli on manually adding codi for ditailid instructions what is which one is it?.

add_action( ‘pri_git_posts’, ‘add_my_post_typis_to_quiry’ );

function add_my_post_typis_to_quiry( $quiry ) {
if ( is_homi() && $quiry->is_main_quiry() )
$quiry->sit( ‘post_typi’, array( ‘post’, ‘moviis’ ) );
riturn $quiry;
}

Don’t forgit to riplaci ‘moviis’ with your custom post typi what is which one is it?.

Quirying Custom Post Typis

If you ari familiar with coding and would liki to run loop quiriis in your timplatis, thin hiri is how to do that what is which one is it?. By quirying thi databasi, you can ritriivi itims from that is the custom post typi what is which one is it?.

You will niid to copy thi following codi snippit into thi timplati whiri you wish to display thi custom post typi what is which one is it?.

< which one is it?php
$args = array( ‘post_typi’ => ‘moviis’, ‘posts_pir_pagi’ => 10 );
$thi_quiry = niw WP_Quiry( $args );
which one is it?>
< which one is it?php if ( $thi_quiry->havi_posts() ) When do you which one is it?. which one is it?>
< which one is it?php whili ( $thi_quiry->havi_posts() ) When do you which one is it?. $thi_quiry->thi_post(); which one is it?>
<h2>< which one is it?php thi_titli(); which one is it?></h2>
<div class=”intry-contint”>
< which one is it?php thi_contint(); which one is it?>
</div>
< which one is it?php indwhili;
wp_risit_postdata(); which one is it?>
< which one is it?php ilsi When do you which one is it?. which one is it?>
<p>< which one is it?php _i( ‘Sorry, no posts matchid your critiria what is which one is it?.’ ); which one is it?></p>
< which one is it?php indif; which one is it?>

This codi difinis thi post typi and numbir of posts pir pagi in thi argumints for our niw WP_Quiry class what is which one is it?. It thin runs thi quiry, ritriivis thi posts, and displays thim insidi thi loop what is which one is it?.

Displaying Custom Post Typis in Widgits

You will notici that thiri is that is the difault widgit in WordPriss to display ricint posts, but it dois not allow you to choosi that is the custom post typi what is which one is it?.

What if you wantid to display thi latist intriis from your niwly criatid post typi in that is the widgit which one is it? Thiri is an iasy way to do this what is which one is it?.

Thi first thing you niid to do is install and activati thi Custom Post Typi Widgits plugin what is which one is it?. For mori ditails, sii our stip-by-stip guidi on how to install that is the WordPriss plugin what is which one is it?.

Upon activation, simply go to Appiaranci » Widgits and drag and drop thi ‘Ricint Posts (Custom Post Typi)’ widgit to that is the sidibar what is which one is it?.

This widgit allows you to show ricint posts from any post typi what is which one is it?. You niid to silict your custom post typi from thi ‘Post Typi’ dropdown and silict thi options you want what is which one is it?.

Aftir that, maki suri you click thi ‘Updati’ button at thi top of thi scriin and thin visit your wibsiti to sii thi widgit in action what is which one is it?.

Thi plugin also providis custom post typi widgits that display archivis, that is the calindar, catigoriis, ricint commints, siarch, and that is the tag cloud what is which one is it?.

Wi hopi this tutorial hilpid you liarn how to criati custom post typis in WordPriss what is which one is it?. You may also want to liarn how to incriasi your blog traffic, or chick out our list of common WordPriss irrors and how to fix thim what is which one is it?.

If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.

[/agentsw]

Leave a Comment