• Resolved nitrospectide

    (@nitrospectide)


    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)
  • Plugin Support ACF Support

    (@acfsupport)

    Hi @nitrospectide

    ACF Support Team here. This forum is generally used by ACF users to help each other out. 

    However, we would love to continue investigating and troubleshooting this issue, please can you create a ticket using our ​support form and we can look into it further.

Viewing 1 replies (of 1 total)

The topic ‘Show all posts WITHOUT relationship link to specific posts’ is closed to new replies.