Site icon Hip-Hop Website Design and Development

query_posts by category_name and custom taxonomy

I want to display posts filtered by category_name and custom taxonomy-term:

I have

function channel_init() {
// create a new taxonomy
register_taxonomy(
    'channel',
    'post',
    array(
        'label' => __( 'Channel' ),
        'rewrite' => array( 'slug' => 'channel' ),
        'hierarchical' => true,
        'capabilities' => array(
            'manage__terms' => 'edit_posts',
            'edit_terms' => 'manage_categories',
            'delete_terms' => 'manage_categories',
            'assign_terms' => 'edit_posts'
        )
    )
);

}
add_action( 'init', 'channel_init' );

Imagine i have a channel-term “news”. And a catgory_name “music” – Now i want to query:

query_posts( array( 'channel' => 'news', 'category_name' => 'music') );

channel is ignored category is filtered only.