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. […]
CPT
Singular vs Plural WordPress Custom Post Type Permalink
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 […]
Broken Custom Post Type Permalinks
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 […]
Prefix WordPress Custom Post Type Names
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 […]