It is possible to change the author name (alias)?
I have translated an article and I want to display that author name instead my name on the article author field.
Thanks in advance!
Hey iostar!
Thank you for using Enfold.
You can edit the author name on the Users panel. Set the Display name publicly as option.
Regards,
Ismael
Thanks for your reply!
I wanted to display my name too on other articles that I wrote, so, if I change my name will be globally changed.
Searching the web, I found something that works somehow, but in case of a new update, I have to rewrite the functions.php in the theme.
The code is this:
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;
}
if( !is_admin() ) {
add_filter( 'author_link', 'my_author_url' );
}
function my_author_url( $url ) {
global $post;
if( get_post_meta($post->ID, 'guest-author', true) ) {
if( get_post_meta($post->ID, 'guest_author_url', true) ) {
return esc_url( get_post_meta($post->ID, 'guest_author_url', true) );
} else {
return '';
}
}
return $url;
}
If you have another idea, please share.
Thanks!
Hi!
You can use a child theme to avoid that. Please see – http://kriesi.at/documentation/enfold/portfolio-item/create-a-child-theme/
You can also download pre-built child theme here – http://kriesi.at/documentation/enfold/downloads/
Regards,
Yigit
Many thanks for your idea. Now I am not afraid of loosing my customizations.
Keep up the good work!