Display Author Alias

Posted in: Newsmag
Post count: 45

Most often, I will posting content on behalf of many random guest authors and I don’t see any value in creating separate author accounts because they are many/random and don’t need to login.
I prefer to use “Custom Fields” option to enter their name in the “author_alias” field.

How can I get the theme to display the alias as the author only if the alias exists, otherwise the actual author name will be displayed.

A friend got the solution below from developers a different theme…how can I implement something similar for Newsmag?


– Locate these 4 lines:

$author = sprintf( ‘%3$s‘,
esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
esc_attr( sprintf( __( ‘View all posts by %s’, ‘icefit’ ), get_the_author() ) ),
get_the_author() );

– Replace them with this:

$alias = get_post_meta ( get_the_id(), ‘author_alias’, true );
if ( ” != $alias):
$author = $alias;
else:
$author = sprintf( ‘%3$s‘,
esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
esc_attr( sprintf( __( ‘View all posts by %s’, ‘icefit’ ), get_the_author() ) ),
get_the_author() );
endif;

Post count: 23312

Hello nkodgh,

Unfortunately, we do not have any tested plugins in this regard and also, the theme does not have such an option that offers you a way to set the Co-Authors, sorry! Please notice that this is not a simple task and it could be made only via custom work and we cannot provide this type of services at the moment, sorry! As a hint, please try to check the following topic for a basic example for this implementation, like this -> https://forum.tagdiv.com/topic/author-alias/
If you want to display more levels in our theme and if you are not aware of the steps which are needed to take in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom work at the moment, sorry!

Thanks for your understanding!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newsmag’ is closed to new topics and replies.