React Material UI and WordPress Admin Area

The fundamental issue is that MUI is probably not meant to be used in an environment where there are already styles like this. It’s supposed to be the base layer. The WordPress admin has its own styles and it’s highly unusual to try and use a completely different UI framework inside of it. These types … Read more

WordPress Customizer Additional CSS – line numbers overlaps CSS code

Instead of doing it that way I found a code snippet to add a new css file. Here is the new code: function add_my_customizer_styles() { wp_enqueue_style( ‘my-customizer-css’, trailingslashit( get_stylesheet_directory_uri() ).’assets/styles/customizer.css’, null ); } add_action( ‘customize_controls_print_styles’, ‘add_my_customizer_styles’, 99 ); That is working fine. Evidently, while the previous code works for some areas of the admin it … Read more

Target “admins” with different styles on the front end [closed]

There are a couple of ways to do this: With template overloads Overload these files: \bp-templates\bp-legacy\buddypress\members\single\profile\edit.php \bp-templates\bp-legacy\buddypress\members\single\profile\change-avatar At the top of the overload, do a current_user_can() check and then do or don’t show the rest of the template. Filter the button creation based on a current_user_can() check. See the filter in bp_get_displayed_user_nav() in ‘bp-members\bp-members-template.php’

theme injecting css into wp-admin

The problem is that you are enqueue the CSS file of your theme outside any of the recommended actions. If you want it to be added only in frontend, you should use wp_enqueue_scripts action: add_action( ‘wp_enqueue_scripts’, function() { wp_register_style( ‘mainstyle’, get_stylesheet_uri()); wp_enqueue_style( ‘mainstyle’, get_stylesheet_uri()); });

custom css in admin panel by user id

Use below code into functions.php file. Make sure you are using it right way use admin_enqueue_scripts add_action(‘admin_enqueue_scripts’, ‘FUNCTION_NAME’);function FUNCTION_NAME() { global $current_user; $user_id = get_current_user_id(); if(is_admin() && $user_id == ‘2’){ wp_enqueue_style( ‘admin_css’, get_template_directory_uri() . ‘/admin-style.css’, false, ‘1.0.0’ ); }}