Category
is the built-in taxonomy for posts
only, not custom post types. So you have to call the pre_get_posts
hook.
This hook is called after the query variable object is created, but
before the actual query is run.
Place the following code to the functions.php
or a custom plugin. Not tested though.
<?php
add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
if( is_category() ) {
$post_type = get_query_var('post_type');
if(!$post_type) {
$post_type = array('nav_menu_item', 'post', 'recetas'); // don't forget nav_menu_item to allow menus to work!
}
$query->set('post_type', $post_type);
return $query;
}
}
This is slightly modified code from here (wpbeginner.com).
If this does not work, use the original code from the link above.