WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
how do I insert the function in my code (1 post)

  1. onirisweb
    Member
    Posted 9 months ago #

    Hi,

    I would like to insert the function that calls co-authors plus plugin in my theme.

    So, here is my function :

    if ( function_exists( 'coauthors_posts_links' ) ) {
        coauthors_posts_links();
    } else {
        get_the_author();
    }

    But because the theme on which I'm working is very particular, I have to implement it in my function.php file within this code :

    case 'author':
    				$result[] = '<span class="art-postauthoricon">' . sprintf(__('<span class="%1$s">By</span> %2$s', THEME_NS),
    								'author',
    								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' ) ),
    									sprintf( esc_attr(__( 'View all posts by %s', THEME_NS )), get_the_author() ),
    									get_the_author()
    								)
    						) . '</span>';
    				break;

    I tried every option (ie : shift "get_the_author()" by the whole function), but every time I get a white screen.

    What's the right way to display it correctly ?

    Thanks for your help

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

Reply

You must log in to post.

About this Plugin

About this Topic