Enable the WordPress admin bar in a single line of code

enable-wordpress-admin-bar

What is this stupid question ?

Well actually it is not so stupid as that! I’ll explain why. (Getting ready he’ll tell us his life.)

Having created a WordPress Theme from A to Z I was looking for a way to activate this famous WordPress admin bar. After much research on the web I realized that there are many tutorials to disable it, customize it, but not to activate it! And in my case (creating a WordPress theme if you followed) it appears that activation of this bar is important.

After this little story telling you my life we’ll go to practice. And it’s so(oooooo) simple!

Enable the WordPress admin bar:

We start by opening index.php (Dashboard / Appearance / Publisher)

Then just put this code:

<?php wp_footer(); ?>

 

just before the closing tag of the body (/ body)

This operation will be repeated on all pages on which you want to add the WordPress admin bar.

Examples:

- Category.php to display it in the categories

- Page.php to display it on your pages

- Single.php to display it on your articles

- etc, etc…

In another tutorial I suggest you to customize the admin bar by adding additional features.


You might also like:

Leave a Reply

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.

Top