Exclude some authors from a query (3 posts)

  1. Nikolas
    Posted 5 years ago #

    Hello there.
    I am looking for a solution, how to make this code work by excluding some authors from it.

    <?php $recent = new WP_Query("showposts=4&orderby=rand"); while($recent->have_posts()) : $recent->the_post();?>

    Like not to show posts from author 4 or 19 or 35.

    Thank you

  2. Nikolas
    Posted 5 years ago #

    I forgot to mention that there is a way to exclude one author. But how about many?

    My final goal is to create a loop, that checks whether an author has a meta tag enabled. If is enabled, then he will be excluded from the randomness. I do not know how to do this, but I think my question is something that i can start my research on it.

  3. Nikolas
    Posted 5 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.