working on a scholar journal in which publisher add issues to the "issue" taxonomy assigned with articles. i need to display outside the loop a list of posts assigned only with the last issue (recently added). any help please?
update: i found a code to get the last term from a taxonomy:
$issue = get_terms('issue','orderby=none&order=DESC&number=1');
$current_issue = $issue[0]->slug;
But i couldn't find a way to use it to display a list of posts assigned only with that last term. any suggestions please?
working on a scholar journal in which publisher add issues to the "issue" taxonomy assigned with articles. i need to display outside the loop a list of posts assigned only with the last issue (recently added). any help please?
update: i found a code to get the last term from a taxonomy:
$issue = get_terms('issue','orderby=none&order=DESC&number=1');
$current_issue = $issue[0]->slug;
But i couldn't find a way to use it to display a list of posts assigned only with that last term. any suggestions please?
If you change the paramter "number" to 2 in the line :
$terms = get_terms( 'issue', 'orderby=id&order=DESC&number=1' );
How to get the term before the last from a custom taxonomy?
WP_Query
with atax_query
to query posts from the returned term – Pieter Goosen Commented Jul 29, 2015 at 13:18