I am developing my own wordpress theme for very first time. I want that when admin login to WordPress, at top admin tool bar must be show on main front end of website.
I tried following things
if (is_user_logged_in())
{
show_admin_bar(true);
}#end if
in functions.php
What I believe that I missed some thing in header.php or index.php, but I am not sure.
The proper way to do this is with a filter in functions.php:
The admin bar is called as part of the wp_footer() function, so you need to make sure you call that function in your footer section of the template:
A discussion of some specific issues that can cause this to break can be found here: http://wordpress.org/support/topic/admin-bar-not-displaying
And finally, more details on how to use the show_admin_bar() in the functions.php file can be found here: http://codex.wordpress.org/Plugin_API/Filter_Reference/show_admin_bar