Support » Plugins » [Plugin: Co-Authors Plus] Unable to bring up posts for co-author in a post array

  • Hi!

    Thank you for an awesome plug-in. I’ve been able to set it up to display co-authors information in the post meta area of my posts, and also to have co-authored posts come up in co-authors’ archive pages.

    However, I’m having trouble bringing up posts for a co-author in a custom array that’s part of my theme, when the author is NOT the primary/first author for the posts…

    This is my code:

    $post_args = array('posts_per_page' => 4, 'author' => $author->ID, 'post_type' => $post_type_array, 'suppress_filters' => 0);
    $slides = get_posts( $post_args );

    Seems to me that this code brings up the posts based on the primary author’s ID, but since co-authors plus stores the co-authors in a taxonomy, not sure how to bring that up.

    I’m not a php expert… any help will be greatly appreciated.

    Thanks!

Viewing 1 replies (of 1 total)
  • Daniel Bachhuber

    (@danielbachhuber)

    Hand Built

    Seems to me that this code brings up the posts based on the primary author’s ID, but since co-authors plus stores the co-authors in a taxonomy, not sure how to bring that up.

    Yep, this is correct. You’ll probably want to use a WP_Query taxonomy query instead, where ‘author’ is the taxonomy, the field is ‘slug’, and the value will be the author’s user_login.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Co-Authors Plus] Unable to bring up posts for co-author in a post array’ is closed to new replies.