work tools

Custom Post Types And How To Make Them

Posts and Pages

So you’ve created a WordPress site and are exploring your freshly installed dashboard. You notice there is a item for ‘Posts’ and an item for ‘Pages’ in the navigation panel.

Posts differ from pages in that pages are static locations on your site and posts are content that can be listed on those pages. For example, most websites have an ‘About’ page that contains fixed information about the individual or organization; this would be an example of a page. Pages can act as fixed locations on your site to view posts. Posts would be something like a blog or newsletter, items that can be archived and are regularly updated. In the most basic form, posts consist of simply text like a newspaper article with maybe a image gallery or embedded video.

Custom Post Types

At this point you may be wondering “is that all WordPress offers? A blogging platform?” Thankfully, with the addition of Custom Post Types, WordPress can be expanded to pretty much any type of website.  Custom Post Types are a way of categorizing posts into different types of information such as ‘Products’ or ‘Reviews’. Each post type gets it’s own entry in the in the WordPress admin panel. Two post types are exampled in the image below.

A post type can be modified beyond the standard blog set of fields to include custom information about your post type. For example, if your custom post type is ‘products’ you could add the field ‘price’.

How To Add Custom Post Types – Plugin Method

You can add a Custom Post Type without breaking a sweat (or a line of code) through plugins. There are many great plugins that automatically create post types for you such as WooCommerce or Easy Digital Downloads. WooCommerce helps you create an online store where you can easily create and sell products through the Custom Post Type ‘Products’.

If you are interested in creating a truly custom post type but don’t want to get into code, you can use a plugin such as Custom Post Type UI. This is an easy to use plugin that will let you set labels and standard fields for a new post type. You can further enhance your post type by using a plugin like Advanced Custom Fields to add additional fields to your new post types. Adding a lot of custom fields through a plugin can cause your site to perform slowly, so be careful and only add the fields you need.

How To Add Custom Post Types – Code Method

If you are ambitious and have access to your site’s backend files, WordPress has a easy system in place to code your own Post Types (even if you have very little development experience). A great resource to get you started coding your own post types is generatewp.com. Simply fill in the information in the generator tabs and click “Update Code”. Once you have your code snippet, copy and paste it into your website theme’s ‘functions.php’ file.

Your functions file can normally be found within the ‘wp-content/themes/[your-theme-name]/’ directory. You will want to ensure you are using a child theme before you add to your functions file or else your custom post type will disappear when you update your theme! If you want to add custom fields through code, CMB2 is a tool that simplifies the process. The advantage to coding in your own custom fields as opposed to using a plugin is that your site will perform faster.

Going forward

If you want to expand your WordPress site by adding post types you now can add them yourself using the tools and methods above. If you want absolute confidence that your site will meet your needs, you can also hire an agency to build your post types for you. iWitness Design offers custom development services and would love to hear about your project.

Click Here To Get In Touch

17279

Was this article helpful?

Sign up to get more content like this sent right to your inbox!

Leave a Reply