Disabling the This Week Widget

Home Forums Calendar Products Events Calendar PRO Disabling the This Week Widget

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1121330
    uwsawebteam
    Participant

    Hello,

    We are working on reducing the number of scripts and styles our site loads, and noticed that with the Events Calendar Pro plugin installed, there are two css and one js files for widget-this-week being loaded on every page.

    We are never planning to use that widget, and are wondering if there is a recommend way to make these items stop enqueuing. I’ve tried de-registering the widget, but the scripts and styles are still loaded.

    Thank you!

    #1121359
    Brian
    Member

    Hi,

    Thanks for using our plugins. I can help out here.

    I created this coding to prevent the javascript and css from being loaded:

    add_action( 'wp_enqueue_scripts', 'tribe_disable_this_week_scripts', 20 );
    function tribe_disable_this_week_scripts() {
    wp_dequeue_script( 'tribe-this-week' );
    wp_dequeue_style( 'widget-this-week-pro-style' );
    wp_dequeue_style( 'tribe_events-widget-this-week-pro-style' );
    }

    Add that to your theme’s functions.php and that should fix it.

    It worked in my test site. Let me know if it works for you.

    Cheers

    #1121743
    uwsawebteam
    Participant

    That works great – thank you!

    #1121911
    Brian
    Member

    Great, glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Disabling the This Week Widget’ is closed to new replies.