I need to display the username of the main site administrator for a part of my template.
I have used the following short code to display the email address of the main administrator of the site with which he started WordPress:
<?php bloginfo('admin_email'); ?>
But I did not find any short code to display the username of the main administrator of the site.
Is there such a shortcode or should I get the username of the main administrator of the site in another way?
>Solution :
There is not a shortcode that I know of, but writing one is very simple, and a great exercise to learn shortcode creation:
function admin_email_shortcode() {
return bloginfo('admin_email');
}
add_shortcode('admin_email', 'admin_email_shortcode');
Simply add that code to your themes functions.php file and use the shortcode [admin_email]
where you want the email address to be displayed.