WordPress.org

Forums

Able
Incorporating Co-Authors Plus plugin into Able theme (2 posts)

  1. mzatynski
    Member
    Posted 1 day ago #

    I've installed and activated the Co-authors Plus plugin, and I can select multiple authors on the back end ... but they're not showing up on the front end.

    The resource I've found is this: http://vip.wordpress.com/documentation/incorporate-co-authors-plus-template-tags-into-your-theme/ ... but from my understanding, the code needed varies by theme.

    Does anyone know now to resolve this in the Able theme? Thanks so much!

    Mandy

  2. chellycat
    Theme Wrangler at Automattic
    Posted 18 hours ago #

    Hi Mandy,

    Based on the link you provided, here is my guess for how you could implement this in the Able theme. First, in inc/template-tags.php, find the following function:

    function able_posted_on() {
    	printf( __( 'Posted on <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="byline"> by <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'able' ),
    		esc_url( get_permalink() ),
    		esc_attr( get_the_time() ),
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() ),
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		esc_attr( sprintf( __( 'View all posts by %s', 'able' ), get_the_author() ) ),
    		esc_html( get_the_author() )
    	);
    }
    endif;

    In the code above, replace "get_the_author()" (third to last line above) with "coauthors_posts_links( null, null, null, null, false )". So the new code would be:

    function able_posted_on() {
    	printf( __( 'Posted on <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="byline"> by <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'able' ),
    		esc_url( get_permalink() ),
    		esc_attr( get_the_time() ),
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() ),
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		esc_attr( sprintf( __( 'View all posts by %s', 'able' ), get_the_author() ) ),
    		coauthors_posts_links( null, null, null, null, false )
    	);
    }
    endif;

    Can you try that and see if it works? I have not tested this since I don't have the plugin installed.

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.