My expansion of Daniel’s code is:
/**
* Co-authors in RSS and other feeds
* /wp-includes/feed-rss2.php uses the_author(), so we selectively filter the_author value
*/
function db_coauthors_in_rss( $the_author ) {
if ( !is_feed() || !function_exists( 'coauthors') ){
#return coauthors__echo( null, null, null, null, false );
return $the_author;
}
else{
#return "hey hey hey";
return coauthors( null, null, null, null, false );
}
}
add_filter( 'the_author', 'db_coauthors_in_rss');
I’ll post any updates here; https://warrengroom.com/wordpress-help/co-authors-wordpress-rss-feeds/
I hope that this helps. Thanks, Daniel
My question is, since the comma is used as a delimiter between authors, how do I add suffixes after a person’s name. For instance: John Smith, MD, PhD
This adds the degrees as separate authors and places them in the wrong order. I tried adding the commas using the HTML code, but this didn’t solve the problem.
Thanks!
]]>https://www.ads-software.com/plugins/co-authors-plus/
https://en-ca.www.ads-software.com/plugins/wordpress-popular-posts/
I have just created a webpage (link here) that uses a child theme of twenty-twelve. I was trying to include coauthors (I have installed coauthors plus) in entry-meta (which, as it is now and I want it to be, it only displays the author of the post and the date), but I don’t know how to do that, my skills are not enough. Whatever help would be deeply appreciated! Code is below.
Many thanks in advance.
*/
function twentytwelve_entry_meta() {
// Translators: used between list items, there is a space after the comma.
$author = sprintf( ‘<span class=”author vcard”>%3$s</span>’,
esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
esc_attr( sprintf( __( ‘View all posts by %s’, ‘twentytwelve’ ), get_the_author() ) ),
get_the_author()
);
$date = sprintf( ‘<time class=”entry-date” datetime=”%3$s”>%4$s</time>‘,
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( ‘c’ ) ),
esc_html( get_the_date() )
);
$categories_list = get_the_category_list( __( ‘, ‘, ‘twentytwelve’ ) );
// Translators: used between list items, there is a space after the comma.
$tag_list = get_the_tag_list( ”, __( ‘, ‘, ‘twentytwelve’ ) );
// Translators: 1 is author, 2 is date, 3 is the category and 4 is tag.
$utility_text = __( ‘Posted <span class=”by-author”> by %1$s</span> on %2$s’, ‘twentytwelve’ );
printf(
$utility_text,
$author,
$date
);
}
endif;
if ( ! function_exists( ‘twentytwelve_entry_meta2’ ) ) :
/**
https://pastebin.com/JTfxz2Yp
A secondary issue is that the coauthors names are being duplicated like the two examples below. I am using the coauthors() function Examples of the code I am using to get these are.
Example One:
LindsayThis entry was contributed by Lindsay, October 26th, 2015 at 1:04 pm and is filed under Capacity Building, Community Partnerships, Diversity.
Example Two:
This entry was contributed by Lindsay and LindsayLindsay and Lindsay, October 26th, 2015 at 1:04 pm and is filed under Capacity Building, Community Partnerships, Diversity.
Code Example:
<?php if( function_exists( 'coauthors' ) ) :
echo '<span class="post-author-meta">This entry was ' . __( 'contributed by', 'reverie' ) coauthors() . ', ' . get_the_time( 'F jS, Y \a\\t g:i a' );
else :
echo '<span class="post-author-meta">This entry was ' . __( 'contributed by', 'reverie' ) get_the_author_meta( 'display_name' ) . ', ' . get_the_time( 'F jS, Y \a\\t g:i a' );
endif;
$coauthors = get_coauthors();
foreach( $coauthors as $coauthor ):
$userdata = get_userdata( $coauthor->ID ); ?>
<div class="entry-author panel contributor-title">
<div class="row">
<div class="large-3 columns">
<div class="img"><?php echo get_avatar( $userdata->user_email, 95 ); ?></div>
<div class="name"><a href="/contributors"><?php echo $userdata->display_name; ?></a></div>
</div>
<div class="large-9 columns">
<p class="cover-description"><?php echo $userdata->user_description; ?></p>
</div>
</div>
</div>
<?php endforeach;?>
https://www.ads-software.com/plugins/co-authors-plus/
]]>While creating the CAP I get an error when attaching the term.id to the guest-author: “Server returned a fault exception: [401] Sorry, one of the given taxonomies is not supported by the post type.”
I have created the CAP post using the “guest-author” post-type and the term using the “author” taxonomy.
In the DB I do not see an entry in the wp_term_relationships table to link the 2 objects (presumably due to the above error).
Note: Creating a CAP via the dashboard is successful.
Here’s the unusual kicker…
I am doing this using VB.net/C# and the WordPressSharp library (https://github.com/abrudtkuhl/WordPressSharp).
For the record, I can attach terms (category and tags) to a default post with post-type “post”. So, I do not believe there is an issue with attaching a term to a post, normally, using the library.
I am including the basics of the VB code and the XML.
Any help sorting out why I am getting this error will be greatly appreciated.
Thank you
Code (main):
'define post and term values
Dim cap_display_name = "John Doe"
Dim cap_first_name = "John"
Dim cap_last_name = "Doe"
Dim cap_user_login = "john-doe"
Dim cap_user_email = "[email protected]"
Dim cap_name = "john-doe"
Dim guest_author_post_name = "cap-john-doe"
Dim customFields() as CustomField = CreateFields()
''Breakout of customFields() essentialy, a hash-array -->
'customField 0: key: "cap-display_name", value: "John Doe"
'customField 1: key: "cap-first_name", value: "John"
'customField 2: key: "cap-last_name", value: "Doe"
'customField 3: key: "cap-user_login", value: "john-doe"
'customField 4: key: "cap-description", value: "Created via XML-RPC"
'customField 5: key: "cap-user_email", value: "[email protected]"
'instantiate WP client
Dim config As New WordPressSiteConfig() With {
.BaseUrl = wpURL,
.BlogId = "3",
.Username = username,
.Password = password
}
Dim client As New WordPressClient(config)
'Create guest-author post
Dim post As New Post() With {
.PostType = "guest-author",
.Title = cap_display_name,
.Name = guest_author_post_name,
.PublishDateTime = Now(),
.CustomFields = customFields,
.Status = "publish"
}
Dim id As Integer = client.NewPost(post)
'Create the term for the author
Dim aid as Interger
Dim capTerm as Term
capTerm.Taxonomy = "author"
capTerm.Name = cap_user_login
capTerm.Slug = guest_author_post_name
capTerm.Description = String.Format("{0} {1} {2} {3} {4} {5}", cap_display_name, cap_first_name, cap_last_name, cap_user_login, chkEmail, id)
aid = client.NewTerm(capTerm)
capTerm.Id = aid
'Add the associated term and metadata
Dim postCAP As New Post()
postCAP.Id = id
postCAP.Terms = capTerm
client.EditPost(postCAP)
XML export (bits):
'Post
<item>
<title>John Doe</title>
<link>https://mypress.com/?post_type=guest-author&p=1413</link>
<pubDate>Sun, 11 Oct 2015 16:55:07 +0000</pubDate>
<dc:creator><![CDATA[mjacobsen]]></dc:creator>
<guid isPermaLink="false">https://mypress.com/?post_type=guest-author&p=1413</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>1413</wp:post_id>
<wp:post_date>2015-10-11 16:55:07</wp:post_date>
<wp:post_date_gmt>2015-10-11 16:55:07</wp:post_date_gmt>
<wp:comment_status>closed</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>cap-john-doe</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>guest-author</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>cap-display_name</wp:meta_key>
<wp:meta_value><![CDATA[John Doe]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>cap-first_name</wp:meta_key>
<wp:meta_value><![CDATA[John]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>cap-last_name</wp:meta_key>
<wp:meta_value><![CDATA[Doe]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>cap-user_login</wp:meta_key>
<wp:meta_value><![CDATA[john-doe]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>cap-description</wp:meta_key>
<wp:meta_value><![CDATA[Created via XML-RPC]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>cap-user_email</wp:meta_key>
<wp:meta_value><![CDATA[[email protected]]]></wp:meta_value>
</wp:postmeta>
</item>
'Term
<wp:term><wp:term_id>1325</wp:term_id><wp:term_taxonomy>author</wp:term_taxonomy><wp:term_slug>cap-john-doe</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[john-doe]]></wp:term_name><wp:term_description><![CDATA[John Doe John Doe john-doe [email protected] 1413]]></wp:term_description></wp:term>
https://www.ads-software.com/plugins/co-authors-plus/
]]>The simple instructions from the plugin are to find this function: (the_author_posts_link();) in my style.css or function.php templates and replace it with: (coauthors_posts_links();)
I am using the Spacious theme, and have NOT modified it in anyway. However, I can not find this function ANYWHERE.
Can someone please help me figure out how to add this function so that multiple authors appear per post?
Thanks!
Andrea
https://www.ads-software.com/plugins/co-authors-plus/
]]>I use a polylang version 1.6.1.1 and i never had the two plugins working well together.
The problem is: if i add a user created by a wordpress, the co-authors show the articles of that user, ok, sounds good, but if i add a user created by a guest method and click to get the articles, i received a 404 page.
Note: If i disable the polylang, everything works great.
thanks in advance
https://www.ads-software.com/plugins/polylang/
]]>This is the blog: www.online-jazz.net
Thanx for your help,
Simone.
https://www.ads-software.com/plugins/co-authors-plus/
]]>The solution lies in replacing the <?php the_author(); ?>
or similar call with another line of code unique to Coauthors:
<?php if ( function_exists( 'coauthors_posts_links' ) ) { coauthors_posts_links(); } else { the_author_posts_link(); } ?>
The problem is I cannot find where to adjust the way the author’s name shows up above the post anywhere in the theme files. I assumed it’d be in index.html, but even if I flat out delete the part of the loop dealing with author names, the post author’s name still appears as if I hadn’t done anything. Suggestions?
]]>