• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Jamie Kembel
  • Home
  • News
  • Portfolio
  • Services
  • Contact
  • Code Samples

How to create a WordPress Custom Post Type

Custom Post Types are by far the simplest way to quickly organize and expand WordPress.

This is especially true when you are trying to create a content management system (CMS) for a customer.
There isn’t a single website that I have created that I haven’t created a custom post type to help organize the back end.

However; it is also key (for me at least) to set up the beginnings of a website as quickly and expeditiously as possible. The design (for me) is always what takes the longest. I want to get the programming out of the way, as soon as possible so I can work on ensuring the site is optimized for search engines (SEO) and laid on in the way the client wants.

For the most part, I keep this code handy. Below is an example of the code I used on this custom post type. (TIPS)

Create a custom post type :


add_action( 'init', 'tips_post_type' );
function tips_post_type() {
register_post_type( 'Tips',
array(
'labels' => array(
'name' => __( 'Tips', 'kembel' ),
'singular_name' => __( 'Tip', 'kembel' ),
),
'exclude_from_search' => false,
'has_archive' => true,
'hierarchical' => true,
'capability_type' => 'page',
'menu_icon' => 'https://kembel.ca/favicon.ico',
'public' => true,
'rewrite' => array( 'slug' => 'tips' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'genesis-seo' ),
)
);
}

About Jamie Kembel

Jamie Kembel is the primary designer and programmer behind Kembel.ca

Jamie has been building websites and dominating results in Google for more than a decade. Jamie's background supporting small businesses and increasing revenue is supported by his tenure as an executive ownership partner for Canada's largest electronics retailer.

Jamie has earned hands-on experience in branding, marketing, and successful online best-practices.

"It isn't about "getting a website". It is about branding, developing and even more importantly... maintaining an online presence for your company."

Primary Sidebar