WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
Double Authors (2 posts)

  1. amandabee
    Member
    Posted 2 years ago #

    I'm having a problem that seems to have been articulated here before but never quite resolved.

    We're using Automattic's Toolbox as a baseline theme. It has a function in functions.php that renders the date and author line:

    function toolbox_posted_on() {
            printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="byline"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'toolbox' ),
                    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' ) ) ),
                    sprintf( esc_attr__( 'View all posts by %s', 'toolbox' ), get_the_author() ),
                    esc_html( get_the_author() )
            );
    }

    (also at http://pastecode.com/bU)

    Any variation that subs in coauthors_posts_links() (eg. http://pastecode.com/bV) results in the authors and links appearing twice, once before the line altogether and once after "by " as expected.

    http://wordpress.org/extend/plugins/co-authors-plus/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    coauthors_posts_links() prints the output... you want to return the value instead. You should be able to use coauthors_posts_links( null, null, null, null, false ). All of the template tags and associated parameters are available for review.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic