Revision: 55932
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at March 1, 2012 00:09 by crypticsoft
Initial Code
$args = array('post_type'=>'bbfitness_exercises', 'tax_query' => array( array( 'taxonomy' => 'bbfitness_exercises_types', 'field' => 'id', 'terms' => $etype ) ) ); // The Query $the_query = new WP_Query( $args ); $result = $the_query->posts;
Initial URL
Initial Description
When you create a custom post type and need to query by ID then you can pass in the 'field' and the 'terms' with the ID for that post type.
Initial Title
WordPress Query Taxonomy by ID
Initial Tags
post, wordpress
Initial Language
PHP