Template option does not show in wordpress custom page

1

I'm creating a new tab that is the same as "page", but separated as the image.

TheproblemisthatIcreatedacustomtemplate,thatis,Icreatedmytheme,inthe"pages" tab the template option appears

Inthe"locations" tab I created, the template option does not appear, does anyone know how to put it?

Follow the code for the register.

function locations_register(){
    $labels = array(
        'name' => _x('Locations','post type general name'),
        'singular_name' => _x('Locations', 'post type singular name'),
        'add_new' => _x('Add new location', 'location'),
        'add_new_item' => __('Add new location'),
        'edit_item' => __('Edit location'),
        'new_item' => __('New location'),
        'view_item' => __('View location'),
        'search_items' => __('Search location'),
        'not_found' => __('Nothing Result'),
        'not_found_in_trash' => __('Nothing result on the bin'),
        'parent_item_colon' => ''
        );

    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => true,
        'has_archive' => false,
        'capability_type' => 'page',
        'hierarchical' => true,
        'menu_position' => 4,
        'taxonomies'=> array('features'),
        'supports' => array('title','thumbnail','editor','page-attributes') 
        );

    register_post_type('location', $args);      
}
    
asked by anonymous 12.09.2017 / 15:49

1 answer

1

If I am not mistaken, it is not allowed in any kind of custom post, this has not been implemented because custom posts can be named using the default WP hierarchy.

For example, you are creating a publication type called location, you can create a template called single-location.php, it will apply the template only to custom posts of that type .. this applies to everything practically ..

Another example, archive-location.php applies to the archive page.

You can even add page- {post-id} .php to create a template for a specific page ... and so on.

    
12.09.2017 / 17:10