WordPress CMS Installation Guide

How to create custom post type in wordpress ?

Posted on

Custom post type? Confused ?
Cheers! Don’t be getting confused. Please read the following paragraph once. 🙂

What is custom post type then?
Custom post type is simply WordPress content like the page, post etc. WordPress simply have following post types.

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

So, post type is simple content and it’s like a content category but not actually category. It’s like a group of content.

How can I register my own custom post type?

Dude! It’s very simple, very means it’s simple 🙂 But the main thing is you have to know what is simple PHP functions and how WordPress PHP file structure is? and some basic WordPress hooks. That’s all for custom post type.

ohh ! Still confusing ? Then let’s write this code in your theme directory’s functions.php.  🙂

// Our custom post type function
function create_posttype() {

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

That’s all for now 🙂 Now look around on backend, you will find your custom post type.

Looks like it’s very interesting?
Want to know more about custom post type?
Then please follow the following official link from WordPress.

https://codex.wordpress.org/Post_Types

themeegg

ThemeEgg is beautiful, modern, clean, responsive, SEO friendly, premium and free WordPress theme and plugin store. We have highly customizable and good looking WordPress themes and plugins to create a beautiful website. We can also provide themes and plugins customization support.

17 comments How to create custom post type in wordpress ?

  1. What is this capacity of this script?It’s advertised as a Giant Social Network Platform.Can it handle over 100 000 users and does it require special server or notCY. it can be used as hosted solution?I will work on a project for a social network similar to baby! or notCY. Would it be possible wiith WP?

    1. Hello Saake-T,
      This script creates a post type on WordPress for Movie Information. WordPress handles millions of users but handling the number of visitors depends upon your hosting bandwidth but not on WordPress website.

      While purchasing your hosting plan, companies will share the information about the bandwidth they are going to provide. If it’s unlimited, that means your site can handle the unlimited number of visitors at a time.

      For Social Networking site on WordPress BuddyPress plugin help you. You can customize this plugin as per your requirement.

      Finally, It is possible with WP.
      Thank You.

  2. Hey exceptional blog! Does running a blog like this take a large amount of work?
    I’ve no expertise in coding but I was hoping to start my own blog soon. Anyway, should
    you have any suggestions or techniques for new blog owners please share.
    I know this is off topic however I simply wanted to ask.
    Thanks a lot!

  3. Wow, fantastic weblog layout! How long have you been blogging for?
    you make blogging glance easy. The total glance of your site is
    magnificent, let alone the content material!

  4. If you are going for most excellent contents like I do, simply pay a quick visit this web page every day since it provides quality contents, thanks

  5. Everything is very open with a very clear clarification of the issues.
    It was really informative. Your site is very useful. Thanks for sharing!

  6. I am extremely impressed with your writing skills and also with the layout on your weblog.
    Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing,
    it’s rare to see a nice blog like this one nowadays.

Leave a Reply

Your email address will not be published. Required fields are marked *