How to add Admin Bar to non-wordpress sites
-
I am having trouble finding a solution, but basically if the user is logged in, i want the admin bar to display on a non-wordpress page.
I have mastered the “Login/Logout” on non-WP pages, but when someone is logged in, I want them to have the WP admin bar shown instead of “Welcome registered user!”
could someone tell me which function and php file the admin bar is displaying?
So in other words, I want my code on non-WP pages to look like this:
require(‘blog/wp-load.php’);
require(‘blog/wp-blog-header.php’);if ( is_user_logged_in() ) {
show_admin_bar();
} else {
header( ‘Location: https://www.mysite.com/blog/wp-login.php’ ) ;};
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to add Admin Bar to non-wordpress sites’ is closed to new replies.