<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom"><title>WordPress Admin Bar Plugin vo.5</title><author><name>Matt Read</name></author><link rel="alternate" href="https://mattread.com/wp-admin-bar"/><link rel="edit" href="https://mattread.com/wp-admin-bar/atom"/><id>http://www.mattread.com/archives/2004/12/wordpress-admin-bar-plugin-vo5/</id><updated>2007-04-06T14:58:21-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-23T16:33:23-04:00</app:edited><published>2004-09-13T08:26:31-04:00</published><category term="wordpress"/><category term="articles"/><content type="html">&lt;p&gt;This plugin will add a bar at the top of your template file with links to the admin sections of WordPress. However it will only add this bar for users that are logged in and have a user level equal to, or above 1.&lt;!--more--&gt;&lt;/p&gt;&#xD;
&#xD;
&lt;p class="note"&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;a href="http://mattread.com/archives/2005/03/wp-admin-bar-20/"&gt;Version 2&lt;/a&gt; of this plugin is now available for WordPress 1.5. For WordPress 1.2 use this version.&lt;/p&gt;&#xD;
&#xD;
&lt;h3&gt;Installation&lt;/h3&gt;&#xD;
&#xD;
&lt;p&gt;To install the script just unpack the archive (link below) and upload the file &lt;code&gt;admin-bar.php&lt;/code&gt; to the plugins folder. Then activate the plugin in the admin area. Then add the following code JUST AFTER THE &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag in your template (&lt;code&gt;index.php&lt;/code&gt;):&lt;/p&gt;&#xD;
&#xD;
&lt;pre class="highlight php"&gt;&lt;?php admin_bar(); ?&gt;&lt;/pre&gt;&#xD;
&#xD;
&lt;p&gt;That's it, easy isn't? Damn, WordPress is good.&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;Actually, that's not quite it. If you have removed the &lt;code&gt;wp_head();&lt;/code&gt; function from the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; of your XHTML, then read read the following Style Sheet section, if not skip the Style Sheet section.&lt;/p&gt;&#xD;
&#xD;
&lt;h3&gt;Style Sheet&lt;/h3&gt;&#xD;
&#xD;
&lt;p&gt;To get the admin bar to display properly, I have added some CSS to the plugin. If you have removed the &lt;code&gt;wp_head();&lt;/code&gt; function from the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; however, the CSS won't be added. So you will have to add it yourself. The admin bar is contained in a list, &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; and has the id &lt;code&gt;#admin&lt;/code&gt;. So you could write your own CSS or use, or modify, the following default CSS:&lt;/p&gt;&#xD;
&#xD;
&lt;pre class="highlight css"&gt;#admin {&#xD;
z-index: 20;&#xD;
width: 100%;&#xD;
margin: 0;&#xD;
background: #666;&#xD;
border-bottom: 2px solid #fff;&#xD;
color: #fff;&#xD;
font-size: 12px;&#xD;
font-family: verdana, sans-serif;&#xD;
text-align: center;&#xD;
}&#xD;
&#xD;
#admin li {&#xD;
display: inline;&#xD;
padding: 5px;&#xD;
}&#xD;
&#xD;
#admin li a {&#xD;
color: #eee;&#xD;
text-decoration: none;&#xD;
letter-spacing: 1px;&#xD;
}&#xD;
&#xD;
#admin li a:hover {&#xD;
color: #bbb;&#xD;
text-decoration: none;&#xD;
}&lt;/pre&gt;&#xD;
&#xD;
&lt;p&gt;And after adding that CSS your done and ready to use the plugin. Have fun.&lt;/p&gt;&#xD;
&#xD;
&lt;h3&gt;Features&lt;/h3&gt;&#xD;
&#xD;
&lt;p&gt;The following is a list of links shown for the different user levels.&lt;/p&gt;&#xD;
&#xD;
- level 10: Write, Edit, Links, Users, Profile, Options and Admin Area&#xD;
- level 5: Write, Edit, Links, Users, Profile and Admin Area&#xD;
- level 4: Write, Edit, Users, Profile and Admin Area&#xD;
- level 1: Write, Edit, Profile and Admin Area&#xD;
&#xD;
&lt;p&gt;When you are view a single post the "Edit" link will appear as "Edit This Post" and take you to the edit section for that post. "Admin Area" is just a link to the default section, Write.&lt;/p&gt;&#xD;
&#xD;
&lt;h3&gt;Future Plans&lt;/h3&gt;&#xD;
&#xD;
&lt;p&gt;I'm thinking that I will add a link to the Categories admin, and when your are viewing posts in a category, link to the edit category. I'm also thinking of adding a notice for when new comments have been made.&lt;/p&gt;&#xD;
&#xD;
&lt;p&gt;If you have any ideas for the admin bar please leave a comment below. Thanks.&lt;/p&gt;&#xD;
</content></entry>
