Skip to content

Instantly share code, notes, and snippets.

@cdils
Created January 29, 2013 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cdils/4668290 to your computer and use it in GitHub Desktop.
Save cdils/4668290 to your computer and use it in GitHub Desktop.
If you've got the WP Types & Views plugin installed, you can use the following to clean up excess CSS and script files in the header.
// Get rid of WP-Views excess code in header
add_action( 'init', 'typeviews_cleanup' );
function typeviews_cleanup() {
if ( !is_admin() ) {
global $WP_Views;
remove_action('wp_print_styles', array($WP_Views, 'add_render_css'));
remove_action('wp_head', 'wpv_add_front_end_js');
wp_dequeue_style( 'views-pagination-style' );
wp_dequeue_script( 'views-pagination-script' );
wp_dequeue_script( 'wpv-date-front-end-script' );
wp_dequeue_script( 'jquery-ui-datepicker' );
wp_dequeue_script( 'jquery-ui-core' );
wp_dequeue_style( 'jquery-ui-datepicker' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment