I’ve created a simple loop. And I have the following array for the query:
$live_tags = array(
'tag' => 'live',
'showposts' => 5,
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC'
);
Where it says 'tag' => 'live'
, I need a logic that asks:
if ('tag' == 'live' || 'category' == 'candy')
But I am unsure how to do that within the WP_Query array.
Anyone know how to retrieve posts from either tag, or category?
You need a
tax_query
.Note that both the
{tax} (string)
andshowposts
arguments have been deprecated for quite some time. I would not recommend using them.