Last active
July 9, 2018 08:09
-
-
Save abouolia/27d103c5c33ca860f353d12c8252f607 to your computer and use it in GitHub Desktop.
Fix: Visual Composer full width row with RTL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This function fixes full width row of Visual Composer plugin with RTL view. | |
* | |
* IMPORTANT NOTE: You should add this script after jquery.js and before js_composer_front.js | |
* | |
* @return void | |
*/ | |
function website_vc_full_width_rtl_inline_script(){ | |
// Can't continue if the current view is not RTL. | |
if( ! is_rtl() ) return; | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function(){ | |
function vc_single_row_full_width_rtl(event, data){ | |
data.el.css('right', data.offset).css('left', 'auto'); | |
} | |
jQuery(document).on('vc-full-width-row-single', vc_single_row_full_width_rtl); | |
}); | |
</script> | |
<?php | |
} | |
add_action('wp_footer', 'website_vc_full_width_rtl_inline_script'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment