Skip to content

Instantly share code, notes, and snippets.

@robneu
Created October 23, 2013 10:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robneu/7116230 to your computer and use it in GitHub Desktop.
Save robneu/7116230 to your computer and use it in GitHub Desktop.
Disable the output of styles in the Simple Social Icons plugin from StudioPress.
<?php
add_action( 'after_setup_theme', 'prefix_disable_simple_social_icons_styles' );
/**
* Remove Simple Social Icons styles.
*
* Simple Social Icons loads styles with a bunch of !important declarataions.
* This will disable the style output and allow you to style your icons in your
* theme more easily.
*
* @author FAT Media, LLC
* @link http://youneedfat.com
*/
function prefix_disable_simple_social_icons_styles() {
if ( class_exists( 'Simple_Social_Icons_Widget' ) ) {
/** Dequeue icon styles */
wp_dequeue_style( 'simple-social-icons-font');
/** Remove the CSS in <head> */
remove_action( 'wp_head', array( Simple_Social_Icons_Widget::get_instance(), 'css' ) );
}
}
@srikat
Copy link

srikat commented Dec 5, 2013

Trying this with Genesis Sample theme.

Results in a Fatal Error.

"Fatal error: Call to undefined method Simple_Social_Icons_Widget::get_instance() in /Users/sridhar/Sites/genesis.dev/wp-content/themes/genesis-sample/functions.php on line 89"

Simple Social Icons plugin is active.

Any ideas?

@iamcanadian1973
Copy link

function remove_widget_action() {
    global $wp_widget_factory;

    remove_action( 'wp_head', array($wp_widget_factory->widgets['Simple_Social_Icons_Widget'], 'css') );
}
add_action('wp_head', 'remove_widget_action', 1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment