Do not duplicate authors in single loop

I’m trying to exclude authors duplication on single loop.

<?php
$author_ids = array();
$args = (array(
‘post_type’ => ‘post’,
‘posts_per_page’ => 3,
‘author__not_in’ => $author_ids,
‘tax_query’ => array( array(
‘taxonomy’ => ‘post_format’,
‘field’ => ‘slug’,
‘terms’ => ‘post-format-aside’
) )
));
$the_query = new WP_Query($args);
while ( $the_query->have_posts() ) :
$author_ids[] = $post->post_author;
$the_query->the_post();
?>

‘author__not_in’ seems not working. What I’m doing wrong?

Read more here:: Do not duplicate authors in single loop

Leave a Reply

Your email address will not be published. Required fields are marked *