From WordPress, 3.1 introduced the concept of the toolbar where logged in user get the black toolbar which will appear at the top of the page.You can quickly and easily create posts, pages, media, users etc using the toolbar.Sometimes your toolbar not appear on the frontend as it is manageable from admin panel.
Today one of my colleagues had asked that How can I display WordPress Toolbar in UI side? because it was not displaying in WordPress URL of my colleague so I was surprised with the question for few seconds.
I have explained that how we can display WordPress toolbar in UI or frontend So I thought it would be good to share this explanation, so it will make clear to all who has the same question in their mind.
To display admin panel toolbar in UI, First of all, go into your profile and you will get below screen.
Here is one option for Toolbar with checkbox Show Toolbar when viewing the site. So tick this option and you will get toolbar in your frontend.
If above option will not work, you can go with the second option,
We can use one the WordPress function show_admin_bar.The show_admin_bar function used to display the status of the Toolbar for the front side of your website.
SYNTAX:
1 2 3 | show_admin_bar( $bool ); |
$bool will be TRUE if want to show the Toolbar, FALSE otherwise.
You need to call this function to display on UI if Toolbar is not displaying in the front end.To call this function ,add this function in functions.php of theme.
Remember: With this function you cannot disable the toolbar on the WordPress dashboard.
Example:
So I have applied optimize table query
1 2 3 | show_admin_bar(true); |
After adding above line of code in your functions.php and you will get the toolbar on the front end of your site.You can also read about to migrate WordPress Site from local to live server and How to hide the success message from Contact Form 7.
If you enjoyed reading this article, feel free to share it on Facebook and Google plus. If you have any question in this article,do let me know via comment section.
Comments (4)