WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a simple example on how to create a user bar or a simple theme with it that can serve me as example.

What I meant is something like we have here on Wordpress Answers if u get above the logo you have a userbar with information when user is logged in and options to login/register when user is not logged in.

I did a small search around here with the terms navigation bar and user bar but didnt find anything for the header.

share|improve this question
What specifically do you need to know? Are you sure this question is specific to WordPress? – t31os Dec 7 '10 at 10:42
Why would it not be specific ? I am looking for Wordpress samples of user bar. – Prix Dec 7 '10 at 11:40
A user bar is not specific to WordPress, it's a HTML element with some links, the bar here for example is actually just an element sat inside the header, with a background that gives the impression of a bar(nothing spectacular). Do you want an example of how to create a div with some links in it? – t31os Dec 7 '10 at 12:15
up vote 2 down vote accepted

If you're looking for an example how this can be done, grab the current development version of wordpress. It's already everything in there you might need / can imagine.

If you don't want to make use of 3.1 but 3.0, use the 3.1 code as the example you're asking for. The user bar is located in admin-bar.php and class-wp-admin-bar.php.

Your theme needs to support admin-bar and the code takes care on it's own by point-cutting the wp_head hook - which you should have in your theme in any case. Script and CSS styles are named 'admin-bar' as well.

So it's basically copying over the files to your site, enabling theme support for it and if there are some 3.1 only functions used therein, work around those. You can additionally move those files to your theme, rename functions and classes to reflect your namespace to have this a bit more separated.

A benefit to make use of that is that your site will be compatible when updating to 3.1.

share|improve this answer

WordPress 3.1 will come with an adminbar in the frontend. You might wanna wait till then?

share|improve this answer
Sounds good but I doubt it will come out before 14th ;) – Prix Dec 7 '10 at 11:39
You can already grab the development version. It's already out. – hakre Dec 7 '10 at 12:50

If you're going to make one yourself, you could just look into the Wordpress Function Reference, which has all the functions you can use to make fancy things happen with wordpress.

I mean, if it's just what's going on above the header, just write a little snippet in your header.php file that uses the functions you want.

share|improve this answer
Thanks but I am after ready examples of this and not what functions I have available to make it. – Prix Dec 7 '10 at 4:08
@Prix At it's very basic, the user bar is just HTML and CSS - are you comfortable with these languages, and editing your theme files? – TheDeadMedic Dec 7 '10 at 11:08
@TheDeadMedix I am just looking into something ready to go I can check, that is all. – Prix Dec 7 '10 at 11:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.