Problem with Coauthors
-
I am managing a site – https://teen.americanobserver.net — on the Morning After theme. It automatically displays an author bio on single.php after the post content. However, some of the articles have two authors, which I maintain with the Coauthors Plus plugin (and sometimes Double Bylines.) When I use these, only the first author on the post shows up — both for the byline and the bio.
How can I get two author bios to show up when two authors are listed?
-
You’re welcome ??
OK, maybe I’m stupid or something, but I can’t get the multiple authors to show up at all. I’m on WP 3.3.1 and I don’t see any code like you’re talking about. The instructions say to replace any code like this:
<?php the_author(); ?>
But, when I search for that, the closest I get is this:
if ( ! function_exists( 'twentyeleven_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. * Create your own twentyeleven_posted_on to override in a child theme * * @since Twenty Eleven 1.0 */ function twentyeleven_posted_on() { printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ), get_the_author() ); } endif;
When I try to work in the Co-Author code here the whole page blows up. Any help?
Take a look at this thread, because a had the same question.
Is there someone who can help me out regarding this problem:
I used the co-author plug-in for this article and manage to setup the authors info below the article. Here’s the link:
https://www.asiapathways-adbi.org/2012/03/reforming-asias-trade-in-services-will-help-human-development/But, when you click the archive link of the author, it display also the co-author bio instead of only one bio.
See below the code. Any help is deeply appreciated.
<?php } } } /*-----------------------------------------------------------------------------------*/ /* Author Box */ /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( 'woo_author' ) ) { function woo_author() { // Author box single post page if ( is_single() && get_option( 'woo_disable_post_author' ) != 'true' ) add_action( 'woo_post_inside_after', 'woo_author_box', 10 ); // Author box author page elseif ( is_author() ) add_action( 'woo_loop_before', 'woo_author_box', 10 ); } } /*-----------------------------------------------------------------------------------*/ /* Single Post Author */ /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( 'woo_author_box' ) ) { function woo_author_box() { global $post; $author_id=$post->post_author; ?> <?php $i = new CoAuthorsIterator(); while($i->iterate()){ ?> <div id="post-author"> <div class="profile-image"> <?php echo get_avatar( get_the_author_meta('ID'), '80' ); ?> </div> <div class="profile-content"> <h4> <?php printf( esc_attr__( 'About %s', 'woothemes' ), get_the_author('description', $author_id) ); ?></h4> <?php echo get_the_author_meta( 'description'); ?> <?php if (is_singular()) : ?> <div class="profile-link"> <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"> <?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'woothemes' ), get_the_author( 'display_name', $author_id ) ); ?> </a> </div><!-- #profile-link --> <?php endif; ?> </div> <div class="fix"></div> </div> <?php } ?> <?php } }
https://www.ads-software.com/extend/plugins/co-authors-plus/
Hi,
My problem is as that of shawn00m…
I am able to select multiple authors while creating a post…
But it does not show when the post is displayed in the site…In co-author plugin documentation it says to replace
“the_author*()” with this
“if(function_exists(‘coauthors_posts_links’))
coauthors_posts_links();
else
the_author_posts_link();“The problem i dunno where i am supposed to find the
“the_author*()”Any help would be appreciated,
and Thank You…Which theme are you using? Can you paste the contents of single.php into a pastebin and share it here?
Thank you for getting back…
The theme i am using is “Twenty Eleven”
Contents of single.php
[ Code moderated. For more than 10 lines of code please use pastebin.com instead. ]
Kindly have a look at it…
Thank you for getting back…
The theme i am using is “Twenty Eleven”
Contents of single.php
<script src=”https://pastebin.com/embed_js.php?i=DhdziUNS”></script>
Kindly have a look at it…
Hi,
My Problem is…
Have installed the co-author plus plugin…
Can add multiple users to my post…But the co-authors are not seen in the post when viewed from the site front end…
The documentation says to look for <?php the_author();
I did not find this any where in the editor…The theme I am using is Twenty Ten. This came with wordpress itself.
This is what is seen in single.php
<?php get_header(); ?>
<div id=”container”>
<div id=”content” role=”main”>
<?php get_template_part( ‘loop’, ‘single’ );?>
</div><!– #content –>
</div><!– #container –>
<?php get_sidebar(); ?>
<?php get_footer(); ?>Please can help me with this…
You’ll want to look at your theme’s functions.php instead.
Alternatively, you can replace uses of the twentyeleven_posted_on() function with your own code that displays the publication date, co-authors information, etc.
Hi Daniel,
Thanks for the suggestion. I have changed the theme to twentyeleven…
In functions.php i have found this code
if ( ! function_exists( ‘twentyeleven_posted_on’ ) ) :
function twentyeleven_posted_on() {
printf( __( ‘<span class=”sep”>Posted on </span><time class=”entry-date” datetime=”%3$s” pubdate>%4$s</time><span class=”by-author”> <span class=”sep”> by </span> <span class=”author vcard”>%7$s</span></span>’, ‘twentyeleven’ ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( ‘c’ ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
esc_attr( sprintf( __( ‘View all posts by %s’, ‘twentyeleven’ ), get_the_author() ) ),
get_the_author()
);
}
endif;Now what changes should i make to this code…
Sorry i have zero knowledge about php…Thanks in advance…
Hello Daniel,
I use the Weaver ii Pro theme, and I posted on their forum re this plugin which would be very handy for me. I figured a child theme would be the perfect place to put the code to make the plugin functional. And it is — because any other modifications would be lost in the next theme upgrade.
(I like the theme because it is highly customizable, flexible and mobile-friendly, even without specific mobile modifications.)
This is what the theme author, Bruce Weaver, replied:
Well, I need to preach a bit here.
1. That approach is entirely unnecessary. The plugin should be written to use a filter for ‘the_author’. That is how WordPress is supposed to work.
2. The replacement example will soon not work. The function ‘the_author()’ is deprecated – it will likely go away from WP soon. There is a replacement, ‘get_the_author()’, and that replacement will run the final output through the ‘the_author’ filter, where a plugin should be able to replace things.
I wonder whether you could do a little more work on the plugin to make it more stable through WP upgrades and theme upgrades.
Bruce provided a hint for stability through WP upgrades, and a child theme would make the plugin survive theme upgrades.
Not everyone who might want to use the plugin is familiar with child themes. Thus a sample child theme including only the necessary modifications for this plugin would be very helpful. I might have posted the instructions, except that, if the plugin uses deprecated functions, its usefulness is rather short-term.
Looking forward to your thoughts on this.
Inge
Hi Dan,
I tried some of the code you shared in this and other posts on the forum but I still can’t seem to get CoAuthors Plus to display both author bios below a post on my site.
My theme uses this code:
</div><!-- #pure_content --> <div class="grey_box <?php disable_grey_box(); ?>"> <div class="right"> <h3><?php _e('About Author'); ?></h3> <div class="thumb"><?php echo get_avatar( get_the_author_meta('email'), '77' ); ?></div><!-- #thumb --> <div class="info"><p><?php the_author_meta("description"); ?></p><a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"><?php _e('View all'); ?> <?php the_author(); ?> <?php _e('posts'); ?>.</a></div><!-- #info --> </div><!--#right--> </div><!-- #grey_box -->
Do you know what I can do to have both author bios listed below the post. Thank you so much!
- The topic ‘Problem with Coauthors’ is closed to new replies.