Using Co-Authors Plus Plugin with News2

March 2014 WordPress Theme
GK User
Sun Apr 27, 2014 8:22 pm
I have multiple authors on my site, and many times we collaborate on articles. I recently installed Co-Authors Plus, but I need to customize the template by replacing "the_author_posts_link()" to instead use "coauthors_posts_links():"

See here: http://vip.wordpress.com/documentation/ ... our-theme/

How do I do that in News2?
User avatar
Senior Boarder

GK User
Mon Apr 28, 2014 10:32 am
Hello,

Author block is generated from News2/gavern/helpers/helpers.layout.fragments.php file. (gk_author function).
Here you can change or add your own modifications.
User avatar
Moderator

GK User
Sun Jun 29, 2014 1:31 am
Sorry to be a pain, but what do I need to change specifically in order to make this work? I never figured it out.
User avatar
Senior Boarder

GK User
Mon Jun 30, 2014 8:20 am
Hi,

Try to replace this fragment from mentioned file (gk_post_meta function):

Code: Select all
<li>
             <li>
                <?php _e('Written by ', GKTPLNAME); ?>
                <a class="url fn n" href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" title="<?php echo esc_attr(sprintf(__('View all posts by %s', GKTPLNAME), get_the_author())); ?>" rel="author"><?php echo get_the_author(); ?></a>
                
             </li>


with this code:

Code: Select all
             <li>
                <?php _e('Written by ', GKTPLNAME); ?>
                <?php coauthors_posts_links(); ?>
             </li>
User avatar
Moderator


cron