0

I am using co-author plus. I would like to display all/recent posts by authors of a post in the sidebar. Is there a way of doing that? Plugins like Author Recent Posts do not work with Co-author plus.

Would be grateful for any suggestions/advice.

VR

  • At first glance it looks like Co-Authors plus overrides most if not all of the mechanisms for searching for posts by an author, so I'm surprised it doesn't just work. I'd start by looking at how Author Recent Posts builds up its list of other posts by the same author and then try and figure out why that's bypassing co-authors plus. Or just enhance it to explicitly make the co-author query too, if you can figure out how co-authors plus stores the extra authors. – Rup Jun 27 '19 at 12:33
  • I'm assuming you want a single listing of posts by all of the co-authors? Or do you want to separate the listings by individual authors? – Gavin Jun 27 '19 at 14:49
  • Yes, a single listing would be fine. Thanks. – len71 Jun 28 '19 at 15:08
0

Not sure if you're looking for an "automated" way of doing this, but in code you can get an array of all co-authors by using $authors = get_coauthors();. Once you have your authors array, you can loop through it and use each author object's ID to get posts by that author:

$authors = get_coauthors();
foreach ( $authors as $author ) {
    $args = array( 'author' => $author->ID );
    $posts = get_posts( $args );
    // echo out your posts
}
| improve this answer | |
  • Is there a way to turn this into a widget that I could use? I am sorry, I do not know how to do this in wordpress/php. – len71 Jun 28 '19 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.