I have this piece of code, but what I really want to do is to get all post displayed from my taxonomy. Where do I place my taxonomy slug to make sure only a certain category posts are displayed? The category slug it's let's say "projects". How to filter this category? Currently it seems that it displays all my posts on the page. Here is the code:
$myterms = get_terms('units', 'orderby=none&hide_empty');
echo $myterms[0]->name;
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();
endwhile;
endforeach;