Hi Guys, I need to create different Guest Authors on my blog. Want to achieve this without using a plugin..
I have tried the script below in my functions file, however it does not seem to be working.
add_filter( ‘the_author’, ‘guest_author_name’ );
add_filter( ‘get_the_author_display_name’, ‘guest_author_name’ );
function guest_author_name( $name ) {
global $post;
$author = get_post_meta( $post->ID, ‘guest-author’, true );
if ( $author )
$name = $author;
return $name;
}
Please advise.
Thanks
Z