I've got the following code in my team-type.php file which I'm using to create a custom taxonomy for a member information:
function create_team_taxonomies() {
$labels = array(
'name' => _x( 'Kategooriad', 'taxonomy general name' ),
'singular_name' => _x( 'Kategooria', 'taxonomy singular name' ),
'search_items' => __( 'Otsi kategooriatest' ),
'all_items' => __( 'Kõik kategooriad' ),
'parent_item' => __( 'Vanem kategooria' ),
'parent_item_colon' => __( 'Vanem kategooria:' ),
'edit_item' => __( 'Muuda kategooriat' ),
'update_item' => __( 'Uuenda kategooriat' ),
'add_new_item' => __( 'Lisa uus kategooria' ),
'new_item_name' => __( 'Uus kategooria nimi' ),
'menu_name' => __( 'Kategooriad' ),
);
$args = array(
'hierarchical' => true, // Set this to 'false' for non-hierarchical taxonomy (like tags)
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'categories' ),
);
register_taxonomy( 'team_categories', array( 'team' ), $args );
}
add_action( 'init', 'create_team_taxonomies', 0 );
But when I call the query in page-team.php the following way:
<?php query_posts( 'post_type=team&cat=noukogu&showposts=15' ); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php $title=s tr_ireplace( '"', '', trim(get_the_title())); $desc=s tr_ireplace( '"', '', trim(get_the_content())); ?>
<div class="member">
<img class="image" src="<?php print team_thumbnail_url($post->ID) ?>" alt="liikme pilt">
<h3 class="title"><?php echo $title; ?></h3>
<p class="description">
<?php echo $desc; ?>
</p>
</div>
<!-- End member -->
<?php endwhile; endif; ?>
All of the member posts show up. Not the noukogu category posts.
Any ideas what might be causing this issue?
UPDATE: I understand now that cat is used for category ID, but when I change it to category_name(to use category slug) no posts show up at all.
cat
is for "category" taxonomy, either ID or name won't work for you because you are using other taxonomy called "team_categories".