Zeige alle Videos nach Tagnamen

Ich muss alle Videos nach Tag-Namen bekommen, und verwende Code wie diesen

$tax_terms = get_terms('media_category', 'orderby=count&order=DESC&hide_empty=0'); foreach ( $tax_terms as $tax_term ) { $posts = get_posts(array( "meta_key" => 'select', "meta_value" => 1, "post_mime_type" => "video", "taxonomy" => $tax_term->taxonomy, "term" => $tax_term->slug, "numberposts" => 100, "posts_per_page" => 100)); ?> 

Aber diese Abfrage gibt keine Elemente zurück, was ist das Problem?

Solutions Collecting From Web of "Zeige alle Videos nach Tagnamen"

Versuche dies. Verwenden Sie für tag_id in get_posts.

 $tax_terms = get_terms('media_category', 'orderby=count&order=DESC&hide_empty=0'); foreach ( $tax_terms as $tax_term ) { $posts = get_posts(array( "meta_key" => 'select', "meta_value" => 1, "tag_id" => 5, "post_mime_type" => "video", "taxonomy" => $tax_term->taxonomy, "term" => $tax_term->slug, "numberposts" => 100, "posts_per_page" => 100));