multiple author in a post

Pending
REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme September 06, 2019
Login to reply
Igor Sunz Support Agent
4 years ago
You can hire our customization team also. webbizdirect@gmail.com
Igor Sunz Support Agent
4 years ago

all functions which generates meta information of post are in functions.php of theme

https://www.screencast.com/t/bLbMvCZSWei

This type of job requires to have strong code skills from you. If you don't have it, you have big chance to break down your site with wrong coding of functions.php file

tech zotezo
4 years ago

Hello,

Here is the code that needs to add in themes functions.php

Integrating Template Tags Into Your Theme #

To integrate Co-Authors Plus, you’ll want to replace existing author template tags in your theme with a simple conditional that uses the Co-Authors Plus template tags if Co-Authors Plus is available. The conditional prevents your site from breaking (e.g. white screen of death) if Co-Authors Plus isn’t activated.

For example, here’s how you would update the_author_posts_link() to instead use coauthors_posts_links():

if ( function_exists( 'coauthors_posts_links' ) ) { 

    coauthors_posts_links();

} else {

    the_author_posts_link();

}

However, the example above is a relatively simplistic way of presenting bylines. There’s a good chance your theme will need an adaptation of it.

For instance, here’s how the change looks for the Hybrid theme:

function hybrid_entry_author_shortcode( $attr ) { 

    $attr = shortcode_atts( array( 'before' => '', 'after' => '' ), $attr );

    if ( function_exists( 'coauthors_posts_links' ) ) {

        $author = coauthors_posts_links( null, null, null, null, false );

    } else {

        $author = '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author_meta( 'display_name' ) ) . '">' . get_the_author_meta( 'display_name' ) . '</a></span>';

    }

    return $attr['before'] . $author . $attr['after'];

}

Here’s the new function for TwentyTen:

if ( ! function_exists( 'twentyten_posted_on' ) ) :

/**

 * Integrate Co-Authors Plus with TwentyTen by replacing twentyten_posted_on() with this function

 */

function twentyten_posted_on() {

    if ( function_exists( 'coauthors_posts_links' ) ) :

        printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),

            'meta-prep meta-prep-author',

            sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',

                get_permalink(),

                esc_attr( get_the_time() ),

                get_the_date()

            ),

            coauthors_posts_links( null, null, null, null, false )

        );

    else:

        printf( __( '<span class="%1$s"<Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),

            'meta-prep meta-prep-author',

            sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',

                get_permalink(),

                esc_attr( get_the_time() ),

                get_the_date()

            ),

            sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',

                get_author_posts_url( get_the_author_meta( 'ID' ) ),

                esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ),

                get_the_author()

            )

        );

    endif;

}

endif;

What is for  our rehub theme?

Thanks

Igor Sunz Support Agent
4 years ago

Our support is for theme, but customization of functions, custom plugin functions falls outside support scope. I can give you only information how to customize theme properly. Check it http://rehubdocs.wpsoul.com/docs/rehub-theme/child-themes/how-to-customize-your-theme/ All other information, you should ask from plugin's provider because I don't know how it works

tech zotezo
4 years ago

I Use Co-Author Plus plugin and show co-author block in article page.

Follow this URL for help https://wpvip.com/documentation/incorporate-co-authors-plus-template-tags-into-your-theme/

What code needs to add?

tech zotezo
4 years ago

Need to add multiple author in a post; plugin will do that by default BUT it doesn't show them on front-end,we need to do some changes in functions.php

How to add the code https://wpvip.com/documentation/incorporate-co-authors-plus-template-tags-into-your-theme/