Getting Co-Authors Plus to work with Oxygen
-
I’m trying to implement Co-Authors Plus plugin into my website. What I’m having trouble with is editing my template to show the co-authors instead of the first author. The instructions unfortunately don’t correlate to the theme I’m using.
I’m new to WordPress (and web development in general) but it appears my template uses shortcodes for the author string in the index and post pages. I thought maybe I could get the multiple authors to show if I modified the shortcodes.php file inside my template. The short code it uses is called [entry-author] and this is the relating code:
/** * Displays an individual post's author with a link to his or her archive. * * @since 0.7.0 * @access public * @param array $attr * @return string */ function hybrid_entry_author_shortcode( $attr ) { $attr = shortcode_atts( array( 'before' => '', 'after' => '' ), $attr ); $author = '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author_meta( 'display_name' ) ) . '">' . get_the_author_meta( 'display_name' ) . '</a></span>'; return $attr['before'] . $author . $attr['after']; }
I tried to change it myself by replacing “get_the_author_meta” with “get_the_coauthor_meta” but now it just says “by Array” on each post. If anyone could point me in the right direction and help me correctly modify my theme to support Co-Authors Plus, that would be brilliant.
Thanks!
- The topic ‘Getting Co-Authors Plus to work with Oxygen’ is closed to new replies.