Show all posts WITHOUT relationship link to specific posts
-
I’m trying to create a custom query in my template file that shows all posts that are by any other author than the ones I specify. It’s set up to do the query against an ACF Relationship field that connects an author with a post. I have reworked this from a custom query that shows all posts by a specific author. That one works as desired, but my “all posts by anyone else” query does not.
$authorID1 = 128; $authorID2 = 126; $thePosts = new WP_Query(array( 'post_type' => 'post', 'posts_per_page' => 10, 'meta_query' => array( array( 'key' => 'author', 'value' => array ($authorID1,$authorID2), 'compare' => 'NOT LIKE' ) ), 'order' => 'DESC', 'orderby' => 'date', 'post_status' => 'publish', ));
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Show all posts WITHOUT relationship link to specific posts’ is closed to new replies.