Integrating Co-Authors Plus Plugin with Verbosa

  • Author
    Posts
  • #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.

    #40924
    Zed
    Cryout Creations mastermind

    You’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.
    #40960

    As far as I can tell, that worked perfectly! Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Integrating Co-Authors Plus Plugin with Verbosa’ is closed to new replies.