I think there is a compatibility problem with WordPress 4.0. I haven’t found an answer, but reply to the thread if you find one please.
You can put it back like this:
<?php coauthors_posts_links(null,null,'Posted by '); ?>
I need the “posted by” to reappear as well. Any help?
Here is my code being used:
<?php if ( function_exists( ‘coauthors_posts_links’ ) ) { coauthors_posts_links(); } else { the_author_posts_link(); } ?>
I also only have one author box at the bottom of my post.
Site:
http://anmnews.com/kentucky-governor-beshear-opens-obamacare-store-front-in-lexington/
My date after the author names has also disappeared. Wondering how to make this reappear as well.
Thanks!
J Craig:
It depends what code you replaced to implement the coauthor function. Some themes have their own custom functions for the author/date display which are configurable in the backend.
If you’re using the built-in WP functions along with Coauthors Plus, then here’s one way:
if ( function_exists( 'coauthors_posts_links' ) ) {
coauthors_posts_links(null,null,'Posted by ');
}
else {
echo 'Posted by';
the_author_posts_link();
}
echo ' on ';
the_time( get_option( 'date_format' ) );
J Craig:
As for the author box at the bottom, your theme is using Fancier Author Box by ThematoSoup. In order to make this work with Coauthors Plus, it would require significant rewriting of that plugin (specifically in ts-fab-construct-tabs.php).
I would recommend asking about this on that plugin’s support forum.
I removed this code <?php newspress_author_meta(); ?>
and replaced it with the coauthor code.
That code you provided did not work. It actually shows the code itself on the byline now.
In that case put that back where it was, and then open your theme’s functions.php and find this code:
// Post Author and Date Design
function newspress_author_meta() {
$archive_year = get_the_time('Y');
$archive_month = get_the_time('m');
$archive_day = get_the_time('d');
?>
<div class="post-author"><span class="post-author"><?php the_author_posts_link(); ?> | </span><span class="post-date"><a href="<?php echo get_day_link( $archive_year, $archive_month, $archive_day); ?>"><?php the_time('F j, Y'); ?></a></span></div>
<?php
}
You can change the part which says<?php the_author_posts_link(); ?> and replace it with
<?php if ( function_exists( 'coauthors_posts_links' ) ) {
coauthors_posts_links();
}
else {
the_author_posts_link();
} ?>
Note: I’m basing this upon the free version of the theme you are using. If the code is different in the premium version, then contact the theme author.
“It actually shows the code itself “
Make sure you wrap it in <?php ?>
This is the exact code from that part of my functions.php:
<div class=”post-author”><span class=”post-author”><?php if ( get_post_meta(get_the_ID(), ‘np_author’, ‘true’) !=” ): echo get_post_meta(get_the_ID(), ‘np_author’, ‘true’); else: the_author_posts_link(); endif; ?> | </span><span class=”post-date”>“><?php the_time(‘F j, Y’); ?></span></div>
<?php
This first code you provided wrapped actually worked in my single.php!
<?php if ( function_exists( ‘coauthors_posts_links’ ) ) {
coauthors_posts_links(null,null,’Posted by ‘);
}
else {
echo ‘Posted by’;
the_author_posts_link();
}
echo ‘ on ‘;
the_time( get_option( ‘date_format’ ) ); ?>
The date isn’t clickable as it previously was, but this not a major concern to me, so thank you!