Hi, I would like to hide the admin name author from posts, only for 'admin' not for other authors' name
How can I do it?
Thank you
How to hide 'admin' name author from posts
(5 posts) (3 voices)-
Posted 3 months ago #
-
Untested, give it a shot.
function hide_post_author_if_admin() { global $graphene_settings; $author = get_the_author_meta('user_login'); if ($author == admin ) { $graphene_settings['hide_post_author'] = true; } } add_action( 'template_redirect', 'hide_post_author_if_admin' );Personal Website prasannasp.net | WordPress Plugins developed by me.
Graphene Child Theme Template | Graphene Theme Tutorials | WordPress tutorials.Posted 3 months ago # -
I added this code at the end of the file functions.php of Graphene theme but doesn't run!
Posted 3 months ago # -
Try this:
function hide_post_author_if_admin() { global $graphene_settings; $author = get_the_author_meta('user_login'); if ( $author == 'admin' ) { $graphene_settings['hide_post_author'] = true; } } add_action( 'template_redirect', 'hide_post_author_if_admin' );Find out how you can support the Graphene theme.
New to the forum? Make sure you read the forum rules.
Like Graphene? Check out Graphene Mobile and Graphene Mobile Neo!Posted 3 months ago # -
it's the same, doesn't run
Posted 3 months ago #
Topic Closed
This topic has been closed to new replies.
