Problems with the Single Page of custom post type
-
My Custom Post Type page does not load my template.
Here is the code for registering cpt:
function cadastro_de_instituicoes(){
// variáveis
$nomeSingular = ‘Institui??o’;
$nomePlural = ‘Institui??es’;
$labels = array(
‘name’ => $nomePlural,
‘singular_name’ => $nomeSingular,
‘menu_name’ => $nomePlural,
‘name_admin_bar’ => $nomeSingular,
‘add_new’ => ‘Nova ‘ . $nomeSingular,
‘new_item’ => ‘Nova ‘ . $nomeSingular,
‘add_new_item’ => ‘Adicionar nova ‘ . $nomeSingular,
‘edit_item’ => ‘Editar ‘ . $nomeSingular,
‘view_item’ => ‘Visualizar ‘ . $nomeSingular,
‘all_items’ => ‘Todas as ‘ . $nomePlural,
‘search_items’ => ‘Procurar ‘ . $nomeSingular,
‘not_found’ => $nomePlural . ‘ n?o encontradas’
);
$supports = array(
‘title’,
// ‘editor’,
‘thumbnail’
);
$args = array(
‘labels’ => $labels,
‘public’ => true,
‘publicly_queryable’ => true,
‘menu_position’ => 20,
‘menu_icon’ => ‘dashicons-admin-home’,
‘supports’ => $supports,
‘rewrite’ => array( ‘slug’ => ‘instituicao’ ),
‘has_archive’ => true
);// registrando o PostType ‘instiuicao’
register_post_type(‘instituicao’, $args);
}
// Chamando fun??o para adicionar o Post Type pelo método cadastro_de_instituicoes
add_action(‘init’, ‘cadastro_de_instituicoes’); `
`I created the files: single-instituicao.php and archive-instituicao.php
But when creating a new Post Type of institution type, some pages appear as 404 and others without the single-institution template.php
I went to Settings-> Permanent Links and clicked Save Changes.
How do I get my Custom Post Type template from singleinstituicao.php?
The page I need help with: [log in to see the link]
- The topic ‘Problems with the Single Page of custom post type’ is closed to new replies.