Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
929 views
in Q2A Core by
How to request users to Block Ad Blocker in Q2A site?. In Wordpress we have some plugins where we can ask user to distable adblocker for my site. But how can we do this for Q2A site.
by
can someone please help on this.

3 Answers

+1 vote
by

Try below script on your body tag. 

<script>
(function(){
  var test = document.createElement('div');
  test.innerHTML = '&nbsp;';
  test.className = 'adsbox';
  document.body.appendChild(test);
  window.setTimeout(function() {
    if (test.offsetHeight === 0) {
        window.alert('PLEASE, disable your AdBlocker !!!');
    }
    test.remove();
  }, 100);
})();
</script>

You can add it from theme-base.php file.

Find public function body_script() and add there.

 

by
i tried this and it was working for few days but now not working
0 votes
by

you can review my site neyseya.com/sor

by
i like your anti adblocker script

can you share it ? or no?
0 votes
by
is there any plugin or script code we can add to request users to disable the adblocker to surf the site ?
...