Removing unnecessary head tags

Home Forums Calendar Products Events Calendar PRO Removing unnecessary head tags

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #46502
    barrelny
    Participant

    What would be the best way to remove or deregister the following script and style tags from the head?

    events.css
    jquery 1.8.3
    jquery.pjax.js
    events.js

    I’m not going to need any of them, so I’d like to remove them to speed up the page load.
    Thanks

    #46521
    Jonah
    Participant

    Hi barrelny, the best way would be to use http://codex.wordpress.org/Function_Reference/wp_dequeue_script

    Here’s an example:

    function remove_styles() {
    if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
    wp_dequeue_style( 'tribe_events-admin-ui' );
    wp_dequeue_style( 'tribe-events-mini-calendar' );
    wp_dequeue_style( 'tribe-events-calendar-style' );
    }
    }
    add_action('wp_print_styles','remove_styles',1);

    function remove_scripts() {
    if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
    wp_dequeue_script( ‘tribe-events-calendar-script’ );
    wp_dequeue_script( ‘tribe-events-pjax’ );
    wp_dequeue_script( ‘tribe-events-mini-calendar’ );
    wp_dequeue_script( ‘jquery-ecp-plugins’ );
    wp_dequeue_script( ‘chosen-jquery’ );
    wp_dequeue_script( ‘tribe_events-admin’ );
    }
    }
    add_action(‘wp_print_scripts’,’remove_scripts’,1);

    Does that help?

    #46530
    barrelny
    Participant

    Thank you – that did the trick!

    #978973
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Removing unnecessary head tags’ is closed to new replies.