Support » Fixing WordPress » 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:


    if ( is_user_logged_in() ) {
    } else {
    header( ‘Location:‘ ) ;


Viewing 1 replies (of 1 total)
  • Every time I try to add a function in :

    if ( is_user_logged_in() ) {
    //adding function here

    i get this error:

    Fatal error: Cannot redeclare _wp_admin_bar_init() (previously declared in…/file/to/path/

    Even though I am requiring all these pages that SHOULD let me use the function to call on non-WP pages


    It should treat the non-wordpress page as a WP page and be able to post the admin bar. unless I am posting the wrong function.

Viewing 1 replies (of 1 total)
  • The topic ‘How to add Admin Bar to non-wordpress sites’ is closed to new replies.