Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created December 5, 2017 19:15
Show Gist options
  • Save djrmom/4fd968e8aa20c636c1e876ed0740fa05 to your computer and use it in GitHub Desktop.
Save djrmom/4fd968e8aa20c636c1e876ed0740fa05 to your computer and use it in GitHub Desktop.
facetwp divi column js
<?php
/**
* updates et_pb_column_single for divi on facet load
*/
add_action( 'wp_head', function() { ?>
<script>
(function($) {
$(document).on('facetwp-loaded', function() {
if ( $( '.et_section_specialty' ).length ) {
$( '.et_section_specialty' ).each( function() {
var this_row = $( this ).find( '.et_pb_row' );
this_row.find( '>.et_pb_column:not(.et_pb_specialty_column)' ).addClass( 'et_pb_column_single' );
});
}
});
})(jQuery);
</script>
<?php }, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment