Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get post by taxonomy

foreach ($myterms as $term) :

$args = array(
    'tax_query' => array(
        array(
            $term->slug
        )
    )
);

//  assigning variables to the loop
global $wp_query;
$wp_query = new WP_Query($args);

// starting loop
while ($wp_query->have_posts()) : $wp_query->the_post();

the_title();
blabla....

endwhile;

endforeach;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #post #taxonomy
ADD COMMENT
Topic
Name
9+7 =