WordPress Custom Post Type Not Appearing In Backend

March 11th, 2013 - Posted by Steve Marks to PHP, Web Development.

I’ve just experienced a problem when working on a WordPress website whereby I registered a custom post type in functions.php, however I could not get it to display in the left hand navigation. I received no errors at all, the post type would just not display.

My code was as follows:

add_action( 'init', 'create_post_types' );
function create_post_types() {
	register_post_type( 'homepage_large_panels',
			'labels' => array(
				'name' => __( 'Homepage Large Panels' ),
				'singular_name' => __( 'Homepage Large Panels' )
		'public' => true

The Solution

After a bit of trial and error, plus further research, I found the following snippet from the WordPress documentation:

(string) (required) Post type. (max. 20 characters, can not contain capital letters or spaces)
Default: None

The $post_type parameter I was using in the code above was 21 characters long so, after changing it to something less than 20 characters, it began to show immediately.

Tags: ,
This entry was posted on Monday, March 11th, 2013 at 9:27 am by +Steve Marks and is filed under PHP, Web Development. You can follow any responses to this entry through the RSS 2.0 feed.

Fear not, we won't publish this

Comments (0)

No comments have been left yet. Be the first