multisite - customize admin bar (desktop+ responsive)

I was trying to customize the admin bar a bit by adding an extra logo, and showing the bar to all users(even non registe

I was trying to customize the admin bar a bit by adding an extra logo, and showing the bar to all users(even non registered ones).

Here's the code from my plugin.

add_filter( 'show_admin_bar', '__return_true' ); 
add_action( 'admin_bar_menu', 'remove_wp_logo', 999 );
add_action( 'admin_bar_menu', 'social_links',11 );

function remove_wp_logo( $wp_admin_bar ) {
    $wp_admin_bar->remove_node( 'wp-logo' );
    $wp_admin_bar->remove_node('view-site');
    if (! current_user_can('administrator')) $wp_admin_bar->remove_node('my-account');
}

function social_links( $wp_admin_bar){

    $Tlogo = "<img src='http://localhost/wp/wp-content/mu-plugins/d.png'>";
    $wp_admin_bar->add_node([
        'id' => 'ds',
        'title' => $Tlogo,
        'href' => '/',
        'meta' => [
        'target' => 'sitepoint'
        ]
    ]);
}

So far I'm able to add the links I need but it only appears on desktop, when I resize the window, everything I added disappears from the responsive menu! Even the search bar.

Is there a way to add my icons to the responsive menu too (with the search button as well, if possible)

Thanks in advance.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745315366a4622193.html

相关推荐

  • multisite - customize admin bar (desktop+ responsive)

    I was trying to customize the admin bar a bit by adding an extra logo, and showing the bar to all users(even non registe

    7小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信