How to use single.php file with custom post types
-
I have wordpress 3.1.
In theme’s functions.php I write in simple code:add_action( 'init', 'create_zombie_post_type' ); function create_zombie_post_type() { register_post_type('zombies', array( 'label' => 'Zombies studio', 'public' => TRUE, ) ); }
Then I create single.php file in theme directory with simple content inside to check the page will be viewed:
You are reading single post
Then I write new post in my zombies post type and try to read it. But I can’t see my content. I can see only my content if I write standart wordpress post but not zombies. Also I can’t use single-zombies.php file too. If I make use twentyten theme of wordpress and want to add my zombies post type I get the same incorrect results.
What I do in wrong way? Codex points that it is possible.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to use single.php file with custom post types’ is closed to new replies.