Adsense: original code, fixed size, how to?

Posted in: Newspaper
Post count: 16

We need to display the original Adsense code in our pages, untouched in any way.

That is:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- sm.ro|top-right - responsive -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-XXXXXXXXXXXXXX"
data-ad-slot="XXXXXXXXXXXXXX"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

instead of

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><div class="td-g-rec td-g-rec-id-header ">
<script type="text/javascript">
var td_screen_width = window.innerWidth;

if ( td_screen_width >= 1140 ) {
/* large monitors */
document.write('<span class="td-adspot-title">Sponsored links</span><ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-XXXXXXXXXXXXXX" data-ad-slot="XXXXXXXXXXXXXX"></ins>');
(adsbygoogle = window.adsbygoogle || []).push({});
}
</script>
</div>

The easiest way is to alter td_block_ad_box.php:

case 'google':
//render the magic google ads :)

// $buffy .= $this->render_google_ads($ad_array[$spot_id], $atts);
$buffy .= $this->render_ads($ad_array[$spot_id], $atts);
break;

Can this be done from Theme Panel…?

Post count: 23312

Hello sortofrobot,

Should work the first Google Adsense example because our Adsense code has the similar structure. Try it and check the results.

Thanks for your understanding!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.