What’s a simple way to check in php if there is more than one author?
For example, I’d like to replace my author avatar at the top of a post with just the blog logo in cases were there are multiple authors (using co-authors plus, of course), and I’d like to remove/replace the custom author box at the bottom of a post for these types as well. So I just need a quick if-then statement, but I’m not yet familiar with the plugin, hoping it’s something easy you can give me . If number of authors is greater than one…
Yep, good point. You could change it around to something like this instead:
<?php if ( function_exists( 'get_coauthors' ) && count( get_coauthors( get_the_id() ) ) > 1 ): ?>
// Do whatever with more than one co-author
<?php else: ?>
// Do whatever with just one or when Co-Authors Plus is deactivated
<?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘[Plugin: Co-Authors Plus] Simple check if more than one author’ is closed to new replies.