lundi 29 décembre 2014

How to create a custom template for this custom post type?


I've created this custom post type.



/* custom post - traveller posts */
add_action( 'init', 'traveller' );
function traveller() {
register_post_type( 'traveller',
array(
'labels' => array(
'name' => __( 'Traveller_Posts' ),
'singular_name' => __( 'Traveller_Post' )
),
'public' => true,
'has_archive' => true,
'capability_type' => array("Traveller_Post", "Traveller_Posts"),
'map_meta_cap' => true,
)
);
}


That creates a post type 'Traveller_posts'


Now I have to create a template for these 'Traveller_post'types.




  • So I created 'single-traveller.php' - Not working.




  • Then I created 'single-traveller_post.php' - also not working




  • Then I tried 'single-traveller_posts.php' - no luck again.




I put all these files into my child theme directory.


Why I am unable to get it works? What can I do to get it works?





Aucun commentaire:

Enregistrer un commentaire