OK. The extra script is this:
(function($){
var scrollCheck;
$(function(){
$("#menu-1-151bc56c .menu-item.fecharpopup").removeClass("fecharpopup");
});
$(window).on("load",function(){
$(document).on("click","#menu-1-151bc56c .menu-item a[data-ps2id-api]",function(){
if(scrollCheck){
clearInterval(scrollCheck);
scrollCheck=null;
}
scrollCheck=setInterval(function () {
if(!$("body").is(":animated")){
$(".dialog-close-button").trigger("click");
clearInterval(scrollCheck);
scrollCheck=null;
}
}, 300);
});
});
})(jQuery);
A proper way to add it is in your theme/child-theme functions.php:
function ps2id_custom_script(){
wp_register_script( 'ps2id-custom-script', '', array('jquery', '', true );
wp_enqueue_script( 'ps2id-custom-script' );
wp_add_inline_script( 'ps2id-custom-script', '(function($){
var scrollCheck;
$(function(){
$("#menu-1-151bc56c .menu-item.fecharpopup").removeClass("fecharpopup");
});
$(window).on("load",function(){
$(document).on("click","#menu-1-151bc56c .menu-item a[data-ps2id-api]",function(){
if(scrollCheck){
clearInterval(scrollCheck);
scrollCheck=null;
}
scrollCheck=setInterval(function () {
if(!$("body").is(":animated")){
$(".dialog-close-button").trigger("click");
clearInterval(scrollCheck);
scrollCheck=null;
}
}, 300);
});
});
})(jQuery);');
}
add_action( 'wp_enqueue_scripts', 'ps2id_custom_script' );
Let me know ??