Where is this inline CSS code [closed]

The CSS code you’re seeing is added by core of WP when admin bar is showing. The function that outputs it is called _admin_bar_bump_cb() and it’s called as hook on wp_head. So how to get rid of it? Just remove this action from that hook: function remove_admin_bar_bump() { remove_action( ‘wp_head’, ‘_admin_bar_bump_cb’ ); } add_action(‘get_header’, ‘remove_admin_bar_bump’); … Read more

Toolbar/topbar missing on homepage only?

As Mayeenul wrote: Use Firebug/Chrome Inspector to see what’s wrong. Look for Javascript Errors in the console see if the Adminbar is inside the DOM but hidden via CSS. It could also be disabled via a filter in PHP with something like this: if( is_front_page() ) { add_filter(‘show_admin_bar’, ‘__return_false’); } … but I would say … Read more

Hide admin bar on all pages except homepage

You should use conditional tag inside function hooked to show_admin_bar filter. add_filter( ‘show_admin_bar’, ‘show_adminbar_on_homepage_only’, 20 ); function show_adminbar_on_homepage_only() { return is_user_logged_in() && is_front_page(); }

Hide admin tool bar from back end dashboard [duplicate]

WordPress page for show_admin_bar says: You cannot turn off the toolbar on the WordPress dashboard However, this trick works function remove_admin_bar() { ?> <style type=”text/css”> body { margin-top: -28px; } body.admin-bar #wphead { padding-top: 0; } #wpadminbar { display: none; } </style> <?php } add_action( ‘admin_head’, ‘remove_admin_bar’ ); In oreder to remove certain menus from … Read more

Display $pagenow error notice on all admin pages

function my_admin_notice() { /* * The class of admin notice should be “notice” plus any one of * -“notice-error”, * -“notice-warning”, * -“notice-success” * -“notice-info”. * Optionally use “is-dismissible” to apply a closing icon. */ echo ‘<div class=”notice notice-info”><p>Custom notice text</p></div>’; } add_action( ‘admin_notices’, ‘my_admin_notice’ ); The only thing is, these notices does not show … Read more

WP Admin Bar shown at the bottom

The admin bar’s markup is added to the bottom of the page by default. Then the admin bar is moved to the top of the page using CSS. There are a couple of different reasons for this, but they’re not important at the moment. From the sounds of things, your browser just isn’t loading the … Read more

Add class to WordPress admin bar?

There isn’t a filter/wrapper for the admin bar CSS that you can plug into , the function is simply function wp_admin_bar_header() { ?> <style type=”text/css” media=”print”>#wpadminbar { display:none; }</style> You can over ride the CSS using !important or use jQuery to prepend a class/id to the bar. Something like: jQuery(“<div id=’custom-width’></div>”).prependTo(“#wpadminbar”);

How to Add a Link to the Drop-Down User Menu in the Admin Bar?

You want to use $wp_admin_bar->add_node( $args ). Below is a tested working example. function wpse_add_toolbar_edit($wp_admin_bar) { $wp_admin_bar->add_node( array( ‘id’ => ‘mylink’, ‘title’ => ‘My New Link’, ‘href’ => ‘mailto:[email protected]’, ‘parent’ => ‘user-actions’ ) ); } add_action(‘admin_bar_menu’, ‘wpse_add_toolbar_edit’, 999); Note: The parent param adds the link to an existing ID. If you need to find the … Read more

Question about how global $wp_admin_bar works

You are not declaring an ‘id’ key. Without one, the id will default to a sanitized version of the ‘title’ value – hence your overwrite. Declare a unique id element, and you should be golden. That said, add_node is now the preferred method of achieving this.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)