You can use the BlockAdBlock (or FuckAdBlock
How do I answer: link
If you have jQuery (usually wordpress uses) you can do this:
<script src="blockAdBlock.js"></script>
<script>
(function() {
function adBlockDetected() {
$(function () {
$('#div_especifica').text("adblock detectado");
});
}
function adBlockNotDetected() {
console.log("Sem adblock");
}
if(typeof blockAdBlock=== 'undefined') {
alert("blockAdBlock não foi carregado");
} else {
blockAdBlock.onDetected(adBlockDetected);
blockAdBlock.onNotDetected(adBlockNotDetected);
blockAdBlock.on(true, adBlockDetected);
blockAdBlock.on(false, adBlockNotDetected);
blockAdBlock.on(true, adBlockDetected).onNotDetected(adBlockNotDetected);
}
blockAdBlock.setOption('checkOnLoad', false);
blockAdBlock.setOption({
debug: true,
checkOnLoad: false,
resetOnEnd: false
});
})();
</script>
Assuming the element is something like:
<div id="div_especifica"></div>
Alternative
If you're using googleanalitycs you could use it like this:
<script>
function possivelAdblockDetectado () {
$(function () {
$('#div_especifica').text("adblock detectado");
});
}
</script>
<script onerror="possivelAdblockDetectado()" async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-xxxxxxxxxxxxxxxx"
data-ad-slot="6440411535"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>