echo $user_name in sidebar
-
OK… So, since I’m managing a site with a lot of contributors, I thought it would be nice to show a greeting at the top of the theme sidebar in the form of
"Hello {$user_name} (Logout)".I’m very new to word press and relatively new to PHP in general, so bear with me. I’ve searched through the support forums, and tried many different things, but nothing seems to work. The $user_* variables don’t appear to be set. I’ve tried using the
get_currentuserinfo()function, as well as making the variables global before that, and nothing seems to work. Even the simplest<?php get_currentuserinfo(); echo $user_name ?>fails.Now, I’ve noticed that that the themes tend to use the functions that are within the template-functions-*.php files. Are they restricted access to only these functions? Does that mean I need to create a new function within one of these files to do what I want, or is there a more graceful way?
Thanks in advance for any pointers anyone might be able to show me.
The topic ‘echo $user_name in sidebar’ is closed to new replies.