Admin Scripts enqueue codes seems ok but not working

Please, try the following code, namespace YOUR_PLUGIN; function backEndAssets() { wp_enqueue_style(‘MYPLUGIN_CSS_URL’, plugin_dir_url(__FILE__) . ‘assets/css/admin-styles.css’); wp_enqueue_script(‘MYPLUGIN_JS_URL’, plugin_dir_url(__FILE__) . ‘assets/js/admin-scripts.js’, array(‘jquery’, ‘media-upload’), ‘1.0.0’, true); } add_action( ‘admin_enqueue_scripts’, __NAMESPACE__ . ‘\backEndAssets’ ); As you are not creating object inside plugin and want to load script then you must define namespace at the begging and define the plugin folder … Read more

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’ ); }}

How to prevent Google adsense invalid impressions while performing admin tasks on my wordpress site?

The advertisements are only displayed on the Front-end of your site (whatever the visitors see). Since the ads are only displayed on the front-end, you don’t have to worry about generating invalid impressions by reloading your admin page, creating posts, etc. So long as you don’t open your website’s front-end area and start reloading like … Read more

How to Disable Color Options?

In TwentyTen’s functions.php the custom background is added in twentyten_setup() which is called on the action ‘after_setup_theme’. So, in your child theme, the following should remove the option completely: // Higher priority to work after TwentyTen add_action( ‘after_setup_theme’, ‘wpse12934_remove_custom_background’, 20 ); function wpse12934_remove_custom_background() { remove_custom_background(); }

modify buddpress adminbar only in admin pages

You ca use the conditional tag is_admin() to check if you are on the front-end or back-end like this: function bp_adminbar_currentsite_menu() { global $bp; if (!is_admin()){ ?> <li> <!– Insert your link url or relative url, and your link text below –> <a href=”http://EXAMPLE.COM”>EXAMPLE LINK TEXT</a> </li> <?php } } // Call The Function Above … Read more

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