Hello,
When I insert an HTML block in posts with the adsense code, it works and displays well before saving draft or publishing. When I save, it displays blank.
The code changes as if it is stripped and added more codes. See below how it changes:
Original code:
[gist type="php"]
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-5839100731048282"
data-ad-slot="9090381681"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
[/gist]
Code after publishing
[gist type="php"]
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" style="display: block; text-align: center; height: 185px;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-5839100731048282" data-ad-slot="9090381681" data-adsbygoogle-status="done"><ins id="aswift_0_expand" style="display:inline-table;border:none;height:185px;margin:0;padding:0;position:relative;visibility:visible;width:737px;background-color:transparent;"><ins id="aswift_0_anchor" style="display:block;border:none;height:185px;margin:0;padding:0;position:relative;visibility:visible;width:737px;background-color:transparent;"><iframe marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&&s.handlers,h=H&&H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&&d&&(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;width:737px;height:185px;" width="737" height="185" frameborder="0"></iframe></ins></ins></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
[/gist]
What is the cause?
When I insert an HTML block in posts with the adsense code, it works and displays well before saving draft or publishing. When I save, it displays blank.
The code changes as if it is stripped and added more codes. See below how it changes:
Original code:
[gist type="php"]
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-5839100731048282"
data-ad-slot="9090381681"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
[/gist]
Code after publishing
[gist type="php"]
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" style="display: block; text-align: center; height: 185px;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-5839100731048282" data-ad-slot="9090381681" data-adsbygoogle-status="done"><ins id="aswift_0_expand" style="display:inline-table;border:none;height:185px;margin:0;padding:0;position:relative;visibility:visible;width:737px;background-color:transparent;"><ins id="aswift_0_anchor" style="display:block;border:none;height:185px;margin:0;padding:0;position:relative;visibility:visible;width:737px;background-color:transparent;"><iframe marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&&s.handlers,h=H&&H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&&d&&(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;width:737px;height:185px;" width="737" height="185" frameborder="0"></iframe></ins></ins></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
[/gist]
What is the cause?