No longer working after I customized my theme's byline
-
Hi, I new to PHP, but trying to create a child theme in order to tweak some things necessary for a website I’m working on. I installed this plugin and it worked great with my theme, until I created a custom byline. Now the posts all appear as written by “Administrator”, rather than by their guest authors.
Here’s the code I added to my child theme’s function.php file to create the new custom byline:
<?php add_action( 'after_setup_theme', 'midwayjournal_setup', 11 ); function midwayjournal_setup() { /* Get the parent theme prefix. */ $prefix = hybrid_get_prefix(); /* Actions and filters calls go here in the future. */ add_filter( "{$prefix}_byline", 'midwayjournal_byline' ); } /** * Function to output the author byline but no date. * */ function midwayjournal_byline( $byline ) { if ( 'post' === get_post_type() ) $byline = '<div class="byline">Written by [entry-author]</div>'; return $byline; } ?>
Maybe it’s just as simple as replacing whatever Co-Authors Plus uses to call the byline with my new custom byline “name”? But I have no idea what I’m really looking for.
Thanks for any help!
The work-in-progress site in question: https://midwayjournal.com/test/https://www.ads-software.com/extend/plugins/co-authors-plus/
- The topic ‘No longer working after I customized my theme's byline’ is closed to new replies.