• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Archives for CPT

CPT

WordPress CPT Best Practices

Last updated on January 13, 2021 by Sal Ferrarello

There are a number of nuances to registering WordPress Custom Post Types (CPTs). Here is a list I find helpful when creating CPTs. CPTs should NOT be defined in the theme Prefix your post type to ensure uniqueness (e.g. fe_recipe, not recipe) and use a maximum of 20 characters Make your post type singular (e.g. […]

Filed Under: Programming Tagged With: CPT, WordPress

Singular vs Plural WordPress Custom Post Type Permalink

Last updated on October 18, 2018 by Sal Ferrarello

One of the most powerful features of WordPress is the ability to create Custom Post Types (CPTs). One of the questions that often arises when creating a CPT is whether the permalink (URL) slug should be singular or plural. e.g. Should the CPT slug be recipe or recipes # plural http://ferrarello.com/recipes/guacamole #singular http://ferrarello.com/recipe/guacamole Yet another […]

Filed Under: Programming Tagged With: CPT, WordPress

Broken Custom Post Type Permalinks

Last updated on July 15, 2016 by Sal Ferrarello

When you first add a new WordPress Custom Post Type (a.k.a. CPT), you may find the URLs do not work. Check Your Custom Post Type First, check that your CPT code is being executed and you see your CPT on the backend (i.e. in /wp-admin/). Second, make certain your Custom Post Type is set to […]

Filed Under: Programming Tagged With: CPT, WordPress

Prefix WordPress Custom Post Type Names

Last updated on July 15, 2016 by Sal Ferrarello

When you call the register_post_type() function to register a custom post type, the first parameter is a unique string to identify the post_type you’re creating. Since this string needs to be unique, it is a bad idea to use a string that others might use (e.g. book). If another plugin does try to register the […]

Filed Under: Programming Tagged With: CPT, WordPress

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in