I would love to get the list of posts by their custom taxonomy (=store) name.
Here is what I have so far, but it is not working.
Please help with the code.
$mystorename is a variable holding the name of the store i want to query by.
Any help will be appreciated.
Thank you
$args = array(
'tax_query' => array(
array(
'taxonomy' => 'store',
'field' => 'name',
'terms' => $mystorename
)
)
);
$postslist = get_posts( $args );if(count($postslist) > 0){ ?>
I’m not sure if the get_posts function supports the tax_query. You might want to try creating a new WP_Query object instead.
How about…