Admin bar is disabled in front

First check admin bar is showing in WP admin. So go to : Users -> YOUR_PROFILE One of the check boxes : “Show Toolbar when viewing site” — make sure that’s checked on . Then if it’s ok add this code to your functions.php : function admin_bar(){ if(is_user_logged_in()){ add_filter( ‘show_admin_bar’, ‘__return_true’ , 1000 ); } … Read more

Wp Admin Bar Customizing Labels

Don’t use add_filter with the_content that way; that is meant for a different context – when you are filtering a returned WP post object. Try something like this instead: function replace_customer_area_title( $wp_admin_bar ) { $newtitle = __(‘Custom Title’, ‘cuar’); $wp_admin_bar->add_node( array( ‘id’ => ‘customer-area’, ‘title’ => $newtitle, ) ); } add_filter( ‘admin_bar_menu’, ‘replace_customer_area_title’ , 33 … Read more

How do I change the hover (focus) color of admin bar from frontend?

switch your hook to [‘admin_bar_menu’] and make things !important. add_action( ‘admin_bar_menu’, ‘change_bar_color1’ ); function change_bar_color1() { ?> <style> #wpadminbar .ab-empty-item, #wpadminbar a.ab-item, #wpadminbar > #wp-toolbar span.ab-label, #wpadminbar > #wp-toolbar span.noticon { color: #FFFFFF !important; } #wpadminbar { background: #ff6000 !important; border-top: 2px solid #000000; border-bottom: 2px solid #000000; border-left: 2px solid #ff6000; border-right: 2px solid … Read more

How do you disable the admin-bar.css

This Should do the trick <?php function adminBar_dequeue() { wp_dequeue_style(‘admin-bar’); wp_deregister_style(‘admin-bar’); } add_action( ‘wp_enqueue_scripts’, ‘adminBar_dequeue’, 9999 ); add_action( ‘wp_head’, ‘adminBar_dequeue’, 9999 ); ?>

How to disable or customize admin bar in back-end

To disable (or in the case which I show below with code, hiding) the adminbar in the back-end you could use following code snippet. Please always backup functions.php before editing/adding code. I added also a capability so the adminbar is still visible for the admin. (which you can remove if wish by removing !current_user_can( ‘manage_options’ … Read more

Remove admin bar “My Sites” link from contributor roll

When you use register_post_type function, in the second parameter ($args) you can change some parameters. See the codex for more informations : https://codex.wordpress.org/Function_Reference/register_post_type#Parameters A good link is also : https://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table to get more information about default capabilites and roles Here is an example from the docs for “book” custom post type (add this in your … Read more

How to remove logged user profile href link

Try the below code, function remove_menuitems_from_admin_bar() { global $wp_admin_bar; $wp_admin_bar->remove_menu(‘wp-logo’); $wp_admin_bar->remove_menu(‘user-info’); $wp_admin_bar->remove_menu(‘site-name’); $wp_admin_bar->remove_menu(‘dashboard’); $wp_admin_bar->remove_menu(‘edit-profile’, ‘user-actions’); $wp_admin_bar->remove_menu(‘my-account’); $user_id = get_current_user_id(); $current_user = wp_get_current_user(); if (!$user_id) return; $avatar = get_avatar($user_id, 26); $howdy = sprintf(__(‘Howdy, %s’), ‘<span class=”display-name”>’ . $current_user->display_name . ‘</span>’); $class = empty($avatar) ? ” : ‘with-avatar’; $wp_admin_bar->add_menu(array( ‘id’ => ‘my-account’, ‘parent’ => ‘top-secondary’, ‘title’ => … Read more

Adding Notification Bubble on Admin Top Bar

I will get you some idea on how to do this as you didn’t mention from where count data will come. Add following code to your theme/child-theme functions.php file function custom_admin_bar_menu() { $pending_count = wc_orders_count(‘pending’); $on_hold_count = wc_orders_count(‘on-hold’); $processing_count = wc_orders_count(‘processing’); if ( current_user_can( ‘manage_options’ ) ) { global $wp_admin_bar; //Add an icon with count … Read more

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