jbrashear72
asked on
how do I Setup templates for WordPress 3.0 Custom Post Type?
I created a post type called Surgeons and I want to set a spacific template for this page type.
It looks like it is just using single.php as the template. How do I change this to a spacific one of my choosing?
Here is the code I added to the functions.php
It looks like it is just using single.php as the template. How do I change this to a spacific one of my choosing?
Here is the code I added to the functions.php
add_action( 'init', 'create_my_post_types' );
function create_my_post_types() {
register_post_type( 'Surgeons',
array(
'labels' => array(
'name' => __( 'Surgeons' ),
'singular_name' => __( 'List Surgeons' )
),
'public' => true,
'hierarchical' => true,
'show_ui' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'menu_position' => 5,
'supports' => array( 'title', 'editor', 'comments', 'trackbacks', 'author', 'excerpt', 'custom-fields', 'thumbnail' ),
'rewrite' => array( 'slug' => 'mypage', 'with_front' => false ),
)
);
}
ASKER
But this is a post not a page. the drop down for templates does not show up.
I was told that if I added a file called single-Surgeons.php that this would work but that is being ignored too.
I was told that if I added a file called single-Surgeons.php that this would work but that is being ignored too.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Add this to the very top:
Open in new window
Then name the file as surgeons.php and add it to your theme folder. You will now have the option to use this page template from the page editor page type drop menu.