Hi,
I’ve got a problem which is probably easy to solve, but I can’t get it done… 🙁
I’m using custom post types with tags. When I add a tag in the back-end, let’s say “marketing”, I can see it on the front-end when I look at all the available tags. But not on a single (custom) post (type), then they are not visable. And if I click on a term and go to the page with all the posts containing that term (domain.com/tag/marketing) it says: Nothing found.
To be clear: if I add a term to a “normal” post (not a custom post type), it works as it should: tag term is visable on single post and when I click on the term I see an overview with posts with that tag term.
At first I created the CPT with the following code:
//Custom post type cases
add_action('init', 'cases_register');
function cases_register() {
$args = array(
'labels' => array(
'name' => __('Cases'),
'singular_name' => __('Case'),
'add_new' => __('Add case'),
'add_new_item' => __('Add case'),
'edit_item' => __('Edit case'),
'new_item' => __('New case'),
'all_items' => __('All cases'),
'view_item' => __('View case'),
'search_items' => __('Search case'),
'not_found' => __('No case found'),
'not_found_in_trash' => __('Nothing found in trash'),
'menu_name' => 'Cases'
),
'public' => true,
'show_ui' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'query_var' => true,
'show_in_nav_menus' => true,
'capability_type' => 'post',
'hierarchical' => true,
'rewrite' => true,
'supports' => array('title', 'thumbnail', 'comments'),
'taxonomies' => array('cases', 'post_tag')
);
register_post_type( 'cases' , $args );
}
When this did not work I tried using the tags field in ACF. But the result is the same. It looks as if the tags are not “tied” to the custom posts.
Anybody any ideas?
Thanks!