What Does CPT Stand For? Learn How to Make Custom Post Types in Word Press!

  • 5 min read
  • December 9, 2024
What Does CPT Stand For? Create Custom Post Types in WP

WordPress is highly versatile, but if you’ve ever wanted to go beyond posts and pages for more customised content (like portfolios, testimonials, or product listings), CPTs are the way to go. But, what does CPT stand for? This guide will walk you through the process of creating a WordPress CPT, giving your website design a more personalised structure tailored to your specific needs.

WordPress homepage

What Does CPT Stand For?

CPT stands for Custom Post Types. In WordPress, everything from blog posts to media files is saved as different post types. By default, WordPress includes several post types, such as post, page, attachment, revision, and nav_menu_item. But what if you want to add a specific type of content, like events or testimonials, with its own structure? This is where custom post types come in.

Creating WordPress custom post types allows you to organise and display specific types of content separately from your regular posts or pages. This WordPress feature offers more flexibility and control over your website design.

How to Create Custom Post Types on WordPress

1. Determine Your WordPress Custom Post Type

Before you start creating, consider what you want to achieve with your custom post type. Are you adding a portfolio, product listings, or an event section? Choosing a clear, descriptive name will help you organise your content more effectively. For example, if you want to add a “Testimonial” section to your website, you might name your custom post type “testimonial.”

2. Register the WordPress Custom Post Type in Your Theme’s functions.php

The simplest way to create a WordPress custom post type is by adding code directly to your theme’s functions.php file. Here’s an example of how to register a custom post type called “Testimonials.”

A screenshot of the code you need to create a CPT (custom post type) in WordPress. This code is for when you're registering your CPT in your theme's functions.php

Here’s a breakdown of this code:

  • Labels: Customises how the post type will appear in the WordPress admin area.
  • Public: If true, the post type is visible to all site visitors.
  • has_archive: Enables archive pages for the post type, allowing users to access all entries (e.g., at yourwebsite.com/testimonials).
  • Rewrite: Sets the URL structure.
  • Supports: Defines features your custom post type supports, like title, editor, thumbnail, and comments.
  • show_in_rest: Enables compatibility with the WordPress block editor (Gutenberg).

Add this code to your theme’s functions.php file, then save it. Once you refresh your WordPress admin panel, you’ll see a new “Testimonials” option in the sidebar.

3. Customise the Display of Your WordPress Custom Post Type

To customise how your custom post types display on your website, you can create template files in your theme. Here are some options:

  • single-[post_type].php: Customise individual posts. For our example, you’d create a single-testimonial.php file.
  • archive-[post_type].php: Customise the archive page displaying all posts of this type. In this case, that’s archive-testimonial.php.

The CMS will automatically recognise these files, allowing you to set up unique layouts for each WordPress custom post type.

4. Adding Custom Taxonomies (Optional)

To categorise testimonials, you might want to create a custom taxonomy. For example, you could categorise testimonials by “Industry” or “Client Type.” Here’s how to add a “Client Type” taxonomy:

A screenshot of the code you need to create a CPT (custom post type) in WordPress. This code is for when you're adding custom taxonomies

This code registers a “Client Type” taxonomy you can use to categorise your testimonial custom post types.

5. Using Plugins to Create Custom Post Types (No Code Required)

If you’re not comfortable editing theme files, plugins like Advanced Custom Fields make it easy to create and manage custom post types without coding. Once installed, this plugin provides an intuitive interface in your WordPress dashboard to set up custom post types and taxonomies.

6. Make Your Custom Post Types Searchable

By default, WordPress doesn’t include custom post types in search results. To make them searchable, add this code to your functions.php file:

A screenshot of the code you need to create a CPT (custom post type) in WordPress. This code is for when you're making your CPTs searchable

This code ensures that your testimonial posts appear in search results.

The WordPress Custom Post Type Unlocks Website Possibilities

WordPress custom post types unlock new possibilities in WordPress, allowing you to organise and display specialised content in a more engaging way. For example, creating a WordPress custom post type for testimonials can help you highlight customer feedback in a more professional and organised way. 

With a few lines of code (or a plugin if you prefer), you can add dynamic sections to your website that go beyond standard blog posts and pages. Experiment with custom post types to bring fresh functionality to your WordPress website design, and enjoy the flexibility to create the site structure that truly fits your vision!

WordPress’s versatility, flexibility and scalability are key factors as to why we work with it at KIJO. If you want support with WordPress custom post types, designing, or developing your WordPress website, contact us today. 

Related Read: Why Use a WordPress Website Design Agency

Book a Complimentary Consultation with KIJO’s Head of Partnerships

Need expert guidance on your next digital project? Book a complimentary, 30-minute consultation with our Head of Partnerships & Co-Founder, Kirk Thompson. During your call, we’ll review your website’s current performance, discuss your goals, analyse competitor insights, and explore the potential of a WordPress-powered site. Let’s bring your vision to life—book your free consultation via the link below:

Book Your Call Now

How to Clear Cache on WordPress
How to Clear Cache on WordPress
Sorry, your browser does not support inline SVG.