• I was just wondering how i could put the wp-admin-bar-top-secondary (account section of wp-adminbar) in my site header via header.php; is there any kind of php function to summon this in my header.php file; could who ever knows how to do this kindly assist me with this tiny issue. Thanks in advance 🙂

    *oh, and am using a local server to test my site.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    I don’t know really, but this is what I would try, hopefully it will get you closer to a solution. First of all, note that the admin bar is normally loaded in the footer after all footer content. CSS is used to move it to the top of the page. Since you would be creating your own menu bar, this may not matter at all.

    First you would want to instantiate a new object with the WP_Admin_Bar class. You could add just the account menu by calling wp_admin_bar_my_account_menu() and passing your admin bar object by reference. There are methods to add or remove various elements to your liking. You would then call the initialize() method and the render() method to output the menu bar.

    There’s likely several issues that will need to be ironed out along the way, but I believe this is a reasonable approach.

    Just wondering how you got on with this? Im looking to do the same thing and not really having much luck.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WordPress Adminbar – wp-admin-bar-top-secondary’ is closed to new replies.