If you are using a plugin like PublishPress Authors to create posts with multiple authors. Or you just want to change the way authors are formated you can hook into the Kadence Theme to change the author HTML output using a custom filter.
First you need to install the code snippets plugin. Then create a snippet and add the below code.
<?php
add_filter( 'kadence_author_meta_output', 'custom_author_by_line' );
function custom_author_by_line( $output ) {
ob_start(); ?>
<span class="posted-by">
<?php do_action('pp_multiple_authors_show_author_box', false, 'inline', false, true); ?>
</span>
<?php
return ob_get_clean();
}
Note: If the code above doesn’t work, replace the line:
<?php do_action('pp_multiple_authors_show_author_box', false, 'inline', false, true); ?>
The line should be replaced as follows:
<?php do_action('pp_multiple_authors_show_author_box', false, 'ppma_boxes_9', false, true); ?>
Where ‘ppma_boxes_9‘ is different for each site, and is found by looking at the plugin’s Author Boxes submenu heading, pictured below.
Or, if you are using Co-Authors Plus to create multiple authors you can use this code:
<?php
add_filter( 'kadence_author_meta_output', 'custom_author_by_line' );
function custom_author_by_line( $output ) {
if ( function_exists( 'coauthors_posts_links' ) ) {
ob_start(); ?>
<span class="posted-by">
<?php coauthors_posts_links( ', ', ' & ', 'By ', null, true ); ?>
</span>
<?php
$output = ob_get_clean();
}
return $output;
}