Replies: 1
I’m trying to get the latest post filtering by post_name but I’m getting all posts and no filtering is being applied:
$args = array(
'post_type' => 'sla_slider',
'tax_query' => array(
array(
'taxonomy' => 'category_tax',
'field' => 'id',
'terms' => 35, //pages
'include_children' => false
)
),
'post_name' => 'molecular-services', //it doesn't filter
'posts_per_page' => 1,
'orderby' => 'date',
'order' => 'DESC'
);
$posts = get_posts($args);
Any idea of where I’m doing wrong? Tks!