I hope anyone can help me.
Is there a way to toggle the visibility of a Divi module with ACF in Wordpress?
I tried it myself an searched in forums
Yes, you can use ACF Plugin for that.
Steps for that:
add_filter( 'body_class', 'acf_toggle_module_class' );
function acf_toggle_module_class( $classes ) {
if( get_field('acf_toggle_module') ) {
$classes[] = 'hide-module';
}
return $classes;
}
.hide-module .acf-toggle-module {
display: none !important;
}