Да. Когда вы идете и Register your Custom Post Type, вы можете установить «таксономии» в массив, содержащий либо/оба ваши пользовательские таксономии, а также таксономии основных категорий и/или post_tag.
Запрашивание эти петли можно сделать в стандартном вызове WP Query
Вот пример. Это проверялось, но должно дать вам представление о том, как установить все:
functions.php
add_action('init', 'codex_custom_init');
function codex_custom_init() {
$args = array(
'labels' => array(
'name' => 'Books',
'singular_name' => 'Book',
'add_new' => 'Add New',
'add_new_item' => 'Add New Book',
'edit_item' => 'Edit Book',
'new_item' => 'New Book',
'all_items' => 'All Books',
'view_item' => 'View Book',
'search_items' => 'Search Books',
'not_found' => 'No books found',
'not_found_in_trash' => 'No books found in Trash',
'parent_item_colon' => '',
'menu_name' => 'Books'
),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array('slug' => 'book'),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments'),
'taxonomies'=>array('category')
);
register_post_type('book', $args);
}
петли
$q = new WP_Query(array(
'post_type'=>'book',
'category_name'=>'fantasy'
));
if($q->have_posts()) : while($q->have_posts()) : $q->the_post();
the_title();the_excerpt();
endwhile;endif;
Спасибо! Точно, что я был после! –