Actually answering this question should be fairly simple, with little wp-knowhow...I just can't figure out what's going wrong:
I added coauthor support and coded a plugin for this purpose. Now everything is working fine except for that i'd like to show the posts of the second author on the second author's author.php as well...
My setup is that I added coauthor="ID" to the post_meta and now I'd like to return all posts on author.php where the current author is the main author (author => ID) and also where the meta data coauthor => "current author ID".
Getting all posts where author => ID is not problem. I am struggling with the other part. I have come up with a query like this:
$postauthor = get_user_by( 'slug', get_query_var( 'author_name' ) ); $postauthor = $postauthor->ID; $args = array( 'post_type' => 'post', 'meta_key' => 'coauthor', 'meta_query' => array( array( 'key' => 'coauthor', 'value' => $postauthor, 'compare' => 'LIKE', ) ) ); $query = new WP_Query( $args );
Coauthor is stored as longtext in the database.