How to hide custom taxonomy posts from recent posts
-
I have some custom taxonomy in my WordPress site, but I want to hide a custom taxonomy post from my Recent posts. I have this code:
$c1 = array(
‘post_type’ => ‘post’,
‘tax_query’ => array(
array(
‘taxonomy’ => ‘quality’,
‘field’ => ‘id’,
‘terms’ => 123,
))
);
$c2 = array(
‘post_status’ => ‘publish’,
‘post__not_in’ => $c1,
‘posts_per_page’ => 10,
);
$recent = new WP_Query($c2);
while ($recent->have_posts()) : $recent->the_post();
But unfortunately it doesn’t work. How should I do this?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to hide custom taxonomy posts from recent posts’ is closed to new replies.