Title: how do I insert the function in my code
Last modified: August 21, 2016

---

# how do I insert the function in my code

 *  [onirisweb](https://wordpress.org/support/users/onirisweb/)
 * (@onirisweb)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-insert-the-function-in-my-code/)
 * 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/](http://wordpress.org/extend/plugins/co-authors-plus/)

The topic ‘how do I insert the function in my code’ is closed to new replies.

 * ![](https://ps.w.org/co-authors-plus/assets/icon-256x256.png?rev=2945095)
 * [Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/co-authors-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/co-authors-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/co-authors-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/co-authors-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/co-authors-plus/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [onirisweb](https://wordpress.org/support/users/onirisweb/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/how-do-i-insert-the-function-in-my-code/)
 * Status: not resolved