How To Create Custom Post Type In WordPress without Plugin.

Introduction.

Today we will know about how to create custom post type In WordPress without Plugin and I will guide you step by step and at the end of the blog, you will be able to create it.

What is Custome Post Type?

Custom Post are content like Posts & Pages which are appears in the left sidebar of WordPress Dasboard. By default, WordPress comes with these post types

  1. Revision
  2. Page
  3. Nav Menu
  4. Post
  5. Attachment

You can create your own any type of how to create custom post type in wordpress step by step and rename it whatever you want.

If you run a movie website then you would definitely have to create a movie post type.

In this site we’re going create our very own custom post type one on the Left sidebar which will allow you to organize your posts more easily and to create more stuff within that custom post type.

Follow this guidelines.

The first thing we have to do is open our cPanel or open our FTP program and find our functions file.

Now go to the file manager and then click to Public_HTML.

 the file manager
the file manager
public html
public html

Select WP-Content.

WP-Content
WP-Content

Click on Theme And select your theme .

Click on Theme
Click on Theme

Tips to find Theme.

1 Tip # If you don’t know which theme you are using right now.

Go to WordPress Dashboard And Click on Appearance >Select Theme there you get your theme name.

 Appearance >Select Theme
Appearance >Select Theme

2 Tip # Go to cPanel>File Manage>public_html>wp-content>themes>wpphd> Select Style.css and click on Edit Button.
On the top you can seen Theme Name.

themes>wpphd> Select Style.css
themes>wpphd> Select Style.css
 Appearance >Select Theme
Appearance >Select Theme
Theme Name
Theme Name

Let Continue to the point.

4 – Select Function.php and Click on Copy .One popup will open and type there > function.php-bkp and click on >Copy files. Now we have our backup file here.

Select Function.php
Select Function.php
 function.php-bkp
function.php-bkp

5 – Select function.php and click on Edit option .One tab will open now Copy this code.

How To Create Custom Post Type In WordPress without Plugin.
// 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' );

Now click on >Save Changes.

And Go to your WordPress Dashboard and Refresh the page now take a look on the left side of the Sidebar. There you get Movies custom Post.

if we click on other Movies right here we’re going to see Add New.
if we click on add new we’re gonna see an editor just like a would for any custom post type or any regular post type for that matter it’s gonna do quick test and say this is my book I like my book click on publish.

Displaying Custom Post Types on Your WordPress Site.

WordPress comes with built-in for displaying your custom post types in left Sidebar.

In case you add a new items into your new custom post type it will display on your website.

There are a many type of methods that you can use, each one has its own benefits.

  • Displaying Custom Post Types in Widgets.
  • Displaying Custom Post Types on The Front Page.
  • Custom Post Type Using Default Archive Template.
  • Using Custom Templates for CPT Archives and Single Entries.

 

My Request 🙏

I have tried my best and put so much effort into writing this blog post and I always try to provide more and more valuable to you all. It’ll be very helpful for me if you consider sharing it on social media networks and also do comment.

SHARING IS CARING

How To Create Custom Post Type In WordPress without Plugin.
About Me

Hi, I’m Vikram Sharma. The founder of this blog TheTechGyaan. I’m a professional part-time blogger, a digital marketer. I’m here to help bloggers like you to create an outstanding blog and earn money from it and also share knowledge about SEO, Blogging.

Read More Article:-

How To Add Image Gallery In WordPress: Step By Step By Vikram Sharma Guide (That ANYONE Can Follow) 2020

How To Install Free SSL Certificate: Secrets Step of 2020

Bluehost India v/s Bluehost.com :Which One is Best in 2020

Install WordPress Plugin – Step By Step Full Guide 2020.

How to Add Your WordPress Site to Google Search Console With This Easy Steps.

Sign Up now to get notification regarding new blogs and Updates.

Leave a Comment

%d bloggers like this: