Skip to content

Instantly share code, notes, and snippets.

@ibndawood
Last active January 16, 2021 14:29
Show Gist options
  • Save ibndawood/68b5c66393b6a1d58646ec56b87516e1 to your computer and use it in GitHub Desktop.
Save ibndawood/68b5c66393b6a1d58646ec56b87516e1 to your computer and use it in GitHub Desktop.
Electro v2 - Load RTL flexslider from WooCommerce and dequeue WP Bakery Page Builder flexslider
add_action( 'wp_enqueue_scripts', 'ec_child_dequeue_js_composer_flexslider', PHP_INT_MAX );
function ec_child_dequeue_js_composer_flexslider() {
if ( is_rtl() && is_woocommerce_activated() ) {
wp_dequeue_script( 'flexslider' );
$flexslider = array(
'handle' => 'wc-flexslider',
'src' => plugins_url( 'assets/js/flexslider/jquery.flexslider.min.js' , WC_PLUGIN_FILE ),
'deps' => array( 'jquery' ),
'version' => '2.7.2',
);
wp_register_script( $flexslider['handle'], $flexslider['src'], $flexslider['deps'], $flexslider['version'], true );
wp_enqueue_script( $flexslider['handle'] );
}
}
@alichamass
Copy link

Dear Support,

Kindly, can you explain more the process, I have update the theme , and now images not showing with RTL.

Regards.

@ibndawood
Copy link
Author

Please add the above code in your child theme's functions.php

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