Search Results for 'dequeue'

Home Forums Search Search Results for 'dequeue'

Viewing 15 results - 166 through 180 (of 274 total)
  • Author
    Search Results
  • #990155
    Nico
    Member

    Hey Matt,

    Thanks for the follow-up! This one was a tricky one to get sorted I must say.

    The thing is that ‘tribe-events-ajax-day’ script sets ‘tribe-events-bar’ as dependency, so that why it got in there anyway! I included the dependency clean up in this modified version of your script. PLease try it out and let me know if it works.


    add_action( 'wp_enqueue_scripts', 'mw_enqueue_fonts' );
    function mw_enqueue_fonts() {
    wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:100,300,400,700,100italic,300italic,400italic,700italic|Roboto:400,700,500italic,500,400italic,300italic,300,100italic,100', array(), CHILD_THEME_VERSION );
    wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css', array(), CHILD_THEME_VERSION );
    if ( tribe_is_day() ) {
    global $wp_scripts;
    $wp_scripts->registered['tribe-events-ajax-day']->deps = array();
    }
    wp_dequeue_script( 'tribe-events-bar' );
    if ( tribe_is_month() || tribe_is_map() || tribe_is_photo() || tribe_is_day() || tribe_is_week() || tribe_is_list_view() ) {
    wp_enqueue_script( 'pondhole-tribe-events-bar', get_stylesheet_directory_uri() . '/js/tribe-events-bar.min.js', array( 'jquery' ) );
    }
    }

    Have a great weekend,
    Best,
    Nico

    #989745
    Ryan
    Participant

    Good catch on it not dequeueing properly in the ‘day view’. Just as a test I renamed the tribe-events-bar.js and tribe-events-bar.min.js in the plugin so it couldn’t load that file and it then works properly (even though there is a console error since there is a file missing). So, for whatever reason the dequeue is not working properly in day view.

    Interesting behavior. Any help would be great!

    Note – I’ve put the file names back to normal so it is currently in the ‘non-working’ state.

    Thanks,

    Matt

    • This reply was modified 10 years, 9 months ago by Ryan. Reason: Make sure you are aware that I've renamed the files back to normal
    #989531
    Ryan
    Participant

    Hey Nico,

    Thanks for the help. Here is the function I’m using to dequeue the script and the enqueue the modified version. Obviously you can ignore the reference to google fonts and font icons.

    add_action( 'wp_enqueue_scripts', 'mw_enqueue_fonts' );
    function mw_enqueue_fonts() {
         wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:100,300,400,700,100italic,300italic,400italic,700italic|Roboto:400,700,500italic,500,400italic,300italic,300,100italic,100', array(), CHILD_THEME_VERSION );
         wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css', array(), CHILD_THEME_VERSION );
         wp_dequeue_script( 'tribe-events-bar' );
         if ( tribe_is_month() || tribe_is_map() || tribe_is_photo() || tribe_is_day() || tribe_is_week() || tribe_is_list_view() ) {
              wp_enqueue_script( 'pondhole-tribe-events-bar', get_stylesheet_directory_uri() . '/js/tribe-events-bar.min.js', array( 'jquery' ) );
         }
    }

    Thanks!

    Matt

    #989515
    Nico
    Member

    Hi Matt,

    Thanks for reaching out to us! I’ll try to help you out fixing this -rather strange- issue!

    From what I’m seeing in the source code ‘tribe-events-bar.min.js’ is getting included twice -both the ‘original’ script and your modified copy- in day view. So I’m guessing the script dequeue is not working properly there.

    Can you paste the actual code you are using to dequeue the script?

    Best,
    Nico

    #989107
    Brook
    Participant

    Howdy again Richard,

    I took a look at your site andinvestigated the error. It does not appear to be a CSS issue, and no JS error is thrown. The likely cause of this error is the Google Maps in your footer. Sometimes other plugins load a different version of Google maps that overrides the usual one, and this can cause problems.

    Trying to integrate the theme might be a bit problematic and require some PHP knowhow, but I will do my best to break it down. First, you might try disabling the footer Map in your theme. If there is a setting, try that. If not, try dequeueing the scripts and hiding the element from displaying. Does our Gmap now display? If so, try unhiding the element. Do they both display? If not, you will likely need to try our a different way to show your gmap in the footer. Perhaps a different plugin, or writing your map using the API loaded with Tribe’s plugin which you could enquque on every page.

    Does that all make sense? Will that work for you? Please let me know.

    Cheers!

    – Brook

    #986561
    Brook
    Participant

    You are very welcome Matt!

    The handle is actually the exact same. You can still dequeue it with tribe-events-bar. All you have to do is disable script_debug, and then tribe-events-bar becomes the minified version. So you can keep this line and you should be up and running:

    wp_dequeue_script( 'tribe-events-bar' );

    Did that work?

    – Brook

    #986189
    Ryan
    Participant

    Hey Brook,

    What is the handle to dequeue the minified version of the tribe-events-bar. I can’t seem to find any reference on how to target the minified version.

    I disabled the function to dequeue the ‘tribe-events-bar’, removed the script_debug and ran another script to show all the handles of the js files and it shows ‘tribe-events-bar’ but no reference to a handle for the minified version so how can I go about targeting the minified one?

    Just about there! Thanks for the continued support.

    Matt

    #986156
    Brook
    Participant

    I’m guessing that leaving the script_debug constant in place is not ideal. How can I go about dequeue-ing the minified version of the tribe-bar script and enqueuing one that I minify?

    That’s a good point Matt. You can disable it, then dequeue …/js/tribe-events-bar.min.js instead.

    Your method of dequeueing works great. I would stick with that so that you can disable script_debug and not have to worry about anything.

    Does that answer all of your questions? I am really happy you were able to get it working.

    Cheers!

    – Brook

    #985673
    Geoff
    Member

    Hey Toby and thanks for getting in touch!

    I just checked the site and was able to access both the calendar (/exhibitions) and a single event without a a 500 error, including using the link you provided. Were you perhaps able to resolve the issue on your own? Or maybe I’m missing something and you can help point me in the right direction.

    I did, however, notice the following console error when viewing the site:

    You have included the Google Maps API multiple times on this page. This may cause unexpected errors. (main.js:60)

    I have seen other types of errors pop up as a results of this (e.g. the map not displaying on the site event post), so you’ll want to be sure to check where that extra instance of the Google Maps API is coming from–such as your theme or another plugin–and dequeue the script that is making that call.

    Cheers!
    Geoff

    #985630
    Ryan
    Participant

    Hey Brook,

    I was enable to get this working by dequeue-ing the ‘tribe-events-bar’ script and enqueue-ing my modified one and putting the script_debug constant in place per your suggestion. Here is the code:

    add_action( 'wp_enqueue_scripts', 'mw_enqueue_fonts' );
    function mw_enqueue_fonts() {
         wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:100,300,400,700,100italic,300italic,400italic,700italic|Roboto:400,700,500italic,500,400italic,300italic,300,100italic,100', array(), CHILD_THEME_VERSION );
         wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css', array(), CHILD_THEME_VERSION );
         wp_dequeue_script( 'tribe-events-bar' );
         wp_enqueue_script( 'pondhole-tribe-events-bar', get_stylesheet_directory_uri() . '/js/tribe-events-bar.js', array( 'jquery' ) );
    }
    define( 'SCRIPT_DEBUG', true );

    I’m guessing that leaving the script_debug constant in place is not ideal. How can I go about dequeue-ing the minified version of the tribe-bar script and enqueuing one that I minify?

    I’m just about there!

    Thanks,

    Matt

    #974007
    Geoff
    Member

    Thanks for confirming that, Shelley!

    You could certainly try removing the calendar’s API scrips using this function in your theme’s functions.php file:

    [php]
    function dequeue_tribe_events_scripts() {
    wp_dequeue_script( ‘tribe-events-pro-geoloc’ );
    }
    add_action(‘wp_enqueue_scripts’, ‘dequeue_tribe_events_scripts’, 100 );
    [/php]

    Let me know if that does the trick. If not, we may need to see if the theme developer can help shed some light here. 🙂

    Cheers!
    Geoff

    #973898
    Geoff
    Member

    Hi Shelley, thanks for getting in touch!

    First off, I really appreciate you letting us know about this. While we can’t always make the plugins compatible with all themes, it helps a ton to know where there are conflicts — this allows us to see if there’s anything we can or should be doing on our end to make the calendar more extensible in future release. So, again, thanks!

    The thing I notice right off the bat is this error message in the console:

    You have included the Google Maps API multiple times on this page. This may cause unexpected errors.

    Does the Risen theme include the Google Maps API on all pages throughout the site? If so, and you plan on using the Google Maps feature in the calendar, then I would suggest dequeuing the instance the theme is injecting to see if that clears things up. The theme developer might even have a handy snippet to help so it only dequeues its instance from calendar pages.

    Let’s start there and see what we find. 🙂

    Cheers!
    Geoff

    #973142
    Nico
    Member

    Garreth,

    Thanks for your patience on this. Here’s the updated code for the ‘Event List’ widget:


    add_action( 'wp_print_styles', function(){ wp_dequeue_style( 'widget-calendar-pro-style' ); } );

    Please let me know if this works for you,
    Have a great Friday,
    Nico

    #972627
    Brian
    Member

    Hi,

    Thanks for using our plugins.

    Looks like a change to the registered name in WordPress is causing this.

    Try out this coding instead, it worked for me:

    add_action( 'wp_enqueue_scripts', 'remove_filter_bar_styles', 100 );
    function remove_filter_bar_styles() {
    wp_dequeue_style( 'Tribe__Events__Filterbar__View-css' );
    }

    Let me know if that works for you.

    Thanks

    #971182
    Nico
    Member

    Hi Garreth,

    Thanks for hitting the forums!

    This snippet should do the trick:


    add_action( 'tribe_pre_get_template_part_pro/widgets/mini-calendar-widget', function() {
    wp_dequeue_style( 'widget-calendar-pro-style' );
    } );

    Let me know if that works for you,
    Best,
    Nico

Viewing 15 results - 166 through 180 (of 274 total)