var dfpElemPre = '#div-gpt-ad-',
dfpId = '1542356449390-0', // sto id
dfpElemPost = '_ad_container',
dfpStoFront = '.sto-ads' + ' ' + dfpElemPre + dfpId + dfpElemPost,
dfpStoNotfront = '.sto-ads' + ' ' + dfpElemPre + dfpId;
if(($(dfpStoFront).length) || ($(dfpStoNotfront).length)){
$('.sto-ads').show();
$('.sto-ads .slide-close').on('click', function(){
$(this).parent().parent().removeClass('in');
});
if ($('body').hasClass('front')) {
setTimeout(function(){
$('.sto-ads').addClass('in');
},300);
console.log('front');
}
else {
// condition for not-front
setTimeout(function(){
$('.sto-ads').addClass('in');
},300);
console.log('not-front');
}
}
console.log('create cookie');
}
else {
$('.sto-ads').hide();
console.log('cookie is working');
}