Exibir Custom Post Type na Página tag.php
-
Pessoal, estou com um probleminha, criei um custom post type….Até ai tudo bem… O grande problema é que a página que é para exibir os posts por tags não aparecem os posts relacionados ao custom post type…Exibe somente os posts do Blog… Alguém sabe me dizer o que pode ser?
// Adiciona uma Página de Trabalhos
add_action( ‘init’, ‘register_cpt_trabalho’ );
function register_cpt_trabalho() {
$labels = array(
‘name’ => _x( ‘Trabalhos’, ‘trabalho’ ),
‘singular_name’ => _x( ‘Trabalho’, ‘trabalho’ ),
‘add_new’ => _x( ‘Add New’, ‘trabalho’ ),
‘add_new_item’ => _x( ‘Add New Trabalho’, ‘trabalho’ ),
‘edit_item’ => _x( ‘Edit Trabalho’, ‘trabalho’ ),
‘new_item’ => _x( ‘New Trabalho’, ‘trabalho’ ),
‘view_item’ => _x( ‘View Trabalho’, ‘trabalho’ ),
‘search_items’ => _x( ‘Search Trabalhos’, ‘trabalho’ ),
‘not_found’ => _x( ‘No trabalhos found’, ‘trabalho’ ),
‘not_found_in_trash’ => _x( ‘No trabalhos found in Trash’, ‘trabalho’ ),
‘parent_item_colon’ => _x( ‘Parent Trabalho:’, ‘trabalho’ ),
‘menu_name’ => _x( ‘Trabalhos’, ‘trabalho’ ),
);add_action(‘init’, ‘add_taxonomy_objects’);
$args = array(
‘labels’ => $labels,
‘hierarchical’ => false,
‘register_meta_box_cb’ => ‘cd_meta_box_add’,
‘supports’ => array( ‘title’, ‘editor’, ‘excerpt’, ‘author’, ‘thumbnail’, ‘custom-fields’ ),
‘taxonomies’ => array( ‘category’, ‘post_tag’ ),
‘public’ => true,
‘show_ui’ => true,
‘show_in_menu’ => true,
‘show_in_nav_menus’ => true,
‘publicly_queryable’ => true,
‘exclude_from_search’ => false,
‘has_archive’ => true,
‘query_var’ => true,
‘can_export’ => true,
‘rewrite’ => true,
‘capability_type’ => ‘post’
);register_post_type( ‘trabalho’, $args );
register_taxonomy_for_object_type( ‘tags’, ‘trabalho’ );}
-
A versão é 3.4.1
- O tópico ‘Exibir Custom Post Type na Página tag.php’ está fechado para novas respostas.