Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter novak1nt

    (@novak1nt)

    I have figured my issue out. So the problem was where I suspected it, in the wp_query selection. So I had the page echo out the sql query from the wp_query selection like so:

    $results = new WP_Query( $coauthor_query );
    echo $results->request;

    From this I was able to see that the ACF meta_key that I created(coauthor2) is displayed as a serialized Author ID. So here is the update to the query:

    $coauthor_query = array(
      'post_type' => 'post',
    	'meta_query' => array(
    		array(
    	    'key' => 'coauthor2',
    			'value' => serialize(strval($author->ID)),
    			'compare' => 'LIKE'
        )
    	)
    );

    Now on my Authors page. It will display all content posted by the author as well as anything he/she has coauthored.

Viewing 1 replies (of 1 total)