Trying to "clean" up the CSS files
-
Hi,
I’m trying to do some site optimization, and as such am trying to “join” my CSS/JS files, into as small amount at possible (in custom CSS/JS files)
So far, its going well – but I’ve hit a roadblock with this plugin. I have a custom plugin, where I am “removing” the queued styles, and then passing back my own custom CSS (where I have pasted the contents in, and tweaked stff like urls(), where they were relative);
<?php /* Plugin Name: My Load Reducer Description: Removes unneeded and unwanted stylesheets from other plugins Version: 0.1 */ //Use a class to avoid conflicts class my_load_reducer { function __construct() { //Hook into wp_enqueue_scripts with a high priority add_action( 'wp_enqueue_scripts', array($this, 'deregister_styles'), 99999 ); } function deregister_styles() { // remove stuff first... wp_deregister_style( 'login-with-ajax' ); wp_deregister_style( 'contact_form_maker_frontend' ); wp_deregister_style( 'fontawesome' ); wp_deregister_style( 'genericons' ); wp_deregister_style( 'maxgalleria-image-tiles' ); wp_deregister_style( 'maxgalleria-image-tiles-skin-standard-css' ); wp_enqueue_style( "common-css", '/wp-content/common.css' ); } } //Instantiate the class $my_load_reducer = new my_load_reducer();
This works fine for all of them, apart from this plugin. I have:
wp_deregister_style( 'maxgalleria-image-tiles' ); wp_deregister_style( 'maxgalleria-image-tiles-skin-standard-css' );
…which should be fine:
// The main styles for this template $main_stylesheet = apply_filters(MAXGALLERIA_FILTER_IMAGE_TILES_MAIN_STYLESHEET, MAXGALLERIA_PLUGIN_URL . '/addons/templates/image-tiles/image-tiles.css'); wp_enqueue_style('maxgalleria-image-tiles', $main_stylesheet); // Load skin style $skin = $options->get_skin(); $skin_stylesheet = apply_filters(MAXGALLERIA_FILTER_IMAGE_TILES_SKIN_STYLESHEET, MAXGALLERIA_PLUGIN_URL . '/addons/templates/image-tiles/skins/' . $skin . '.css', $skin); wp_enqueue_style('maxgalleria-image-tiles-skin-' . $skin, $skin_stylesheet);
…yet I still see it in the source code: (I have cleared the W3 Total Cache plugin’s caches’ multiple times, but still no joy)
<link rel='stylesheet' id='maxgalleria-image-tiles-css' href='https://steamrev-d72.kxcdn.com/wp-content/plugins/maxgalleria/addons/templates/image-tiles/image-tiles.css?ver=1431363364' type='text/css' media='all' /> <link rel='stylesheet' id='maxgalleria-image-tiles-skin-standard-css' href='https://steamrev-d72.kxcdn.com/wp-content/plugins/maxgalleria/addons/templates/image-tiles/skins/standard.css?ver=1431363364' type='text/css' media='all' />
Any ideas?
TIA ??
Andy
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Trying to "clean" up the CSS files’ is closed to new replies.