Web Programming

Menyembunyikan Adsense pada Mobile View WordPress

Simply modify this following code based on your website needs :

<?php
//Jadikan Kode Adsense Sebagai Variable dalam PHP
$googleadsensecode = '
<div align="center">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Mobile - di atas & bawah post -->
<ins class="adsbygoogle"
 style="display:block"
 data-ad-client="ca-pub-8661695204103376"
 data-ad-slot="1606610287"
 data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>';
if ( !wp_is_mobile() ) { 
//TAMPILKAN
echo $googleadsensecode; 
} else {
 //do nothing
}
?>

Leave a Reply