admin-bar.php -&- functions.php -&- WP toolbar/admin bar removal
I am no expert at PHP, but learning more every day.
In an attempt to remove the toolbar/admin bar from the front end of the site I tried quite a few things.
- most people online "outside of this forum" approached it through the functions.php file by adding: show_admin_bar(false);
I personally did not have any luck going that route. I finally approached it from the admin-bar.php file in Vantage's includes folder.
- first attempt was to comment out [ //add_filter( 'show_admin_bar', '__return_true', 999 ); ] and it did not work, but my FTP was down so I edited it through Cpanel and I am not sure if that might have caused an issue.
- my second attempt was to adjust the same line's [ return_true ] over to [ return_false ] and it WORKED. I did have FTP access back at this point.
1. Why would adding the show_admin_bar(false); code to functions.php not work? Is it because this theme has an admin-bar.php file that was maybe overriding it?
2. Why would commenting out the first line of admin-bar.php not work and adjusting it from true to false did work? To me I can see them doing two completely different things, but again I am still learning PHP and curious as to the reasoning behind it.... or could it have been an issue with editing it through cPanel?
3. Final question, while reading about PHP it seemed like the script always needs to start with <?php and end with ?>. While working on admin-bar.php I never saw the ?> ending, why is that?
I understand these questions are broad-ranging and not completely specific to Appthemes, but I would be very thankful to anyone that can help me out by explaining the situation I ran into.