DEAL ENDS IN:

SPRING SALE!

UP TO 35% OFF!

GET IT NOW

Fix: Elementor Videos Not Loading with Ajax in If-So

If your conditional Elementor video element isn’t loading with Ajax enabled in If-So, add this code snippet to the end of your theme’s functions.php file:

add_action('wp_enqueue_scripts',function(){ if(!function_exists('wp_add_inline_script')) return; wp_add_inline_script( 'if-so', " document.addEventListener('ifso_ajax_triggers_loaded',function(){ if(document.querySelectorAll('.elementor-video').length<=0) return; var initFrontendIfPossible = function(){if(typeof(YT)!=='undefined'){elementorFrontend.init();return true;}return false;} initFrontendIfPossible(); var interval = setInterval(function(){ if(initFrontendIfPossible()) clearInterval(interval); },1000) });"); },100);