-
AuthorPosts
-
November 12th, 2016 at 07:28 #40663
I am not very knowledgeable with PHP, but I am trying to make this plugin work with this theme.
https://wordpress.org/plugins/co-authors-plus/
The issue is the front-end part.
https://vip.wordpress.com/documentation/incorporate-co-authors-plus-template-tags-into-your-theme/
I am not sure where/how to do this on this theme. I thought I got it working, but it was putting “array” as the author on the posts instead of the two coauthors.
November 23rd, 2016 at 14:03 #40924ZedCryout Creations mastermindYou’ll need to customize the theme function that displays the author(s):
if (function_exists('get_coauthors')): function verbosa_posted_author() { $verbosa_meta_author = cryout_get_option( 'verbosa_meta_author' ); if ($verbosa_meta_author) { $first = true; $output = ''; foreach(get_coauthors() as $coauthor){ if(!$first){ $output .= ', '; } else { $first = false; } $output .= sprintf( '<a class="url fn n" href="%1$s" title="%2$s"' . cryout_schema_microdata('author-url', 0) . '> <em' . cryout_schema_microdata('author-name', 0) . '>%3$s</em> </a>', get_author_posts_url( $coauthor->ID ), sprintf( esc_attr( __( 'View all posts by %s', 'verbosa' ) ), $coauthor->display_name ), $coauthor->display_name ); }; echo sprintf( '<span class="author vcard"' . cryout_schema_microdata('author', 0) . '> <i class="icon-pen icon-metas" title="'.__("Author", "verbosa").'"></i> %1$s </span>', $output ); } } // verbosa_posted_author endif;
Note that I did not test this code so it may be safer to include it and test it on a dev site.
- This reply was modified 8 years ago by Zed. Reason: corrected a text-domain in the code
If you like our creations, help us share by rating them on WordPress.org.
Please check the available documentation and search the forums before starting a topic.November 25th, 2016 at 22:24 #40960As far as I can tell, that worked perfectly! Thank you!
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
The topic ‘Integrating Co-Authors Plus Plugin with Verbosa’ is closed to new replies.