Hi espace69.
What is the issue you are having?
Cheers,
I have only the ad for the first article. Other article haven’t got ad at the end of article.
I have this code :
<div class="post-content">
<div id="content-perso">
<?php the_content(); ?>
<?php avada_link_pages(); ?>
</div>
<h4 class='ailleursurlenet'>Ailleurs sur le web</h4>
<script async src='//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'></script>
<!-- corr-spon -->
<ins class='adsbygoogle'
style='display:block'
data-ad-client='ca-pub-XXXXXXX'
data-ad-slot='XXXXXXXXXXX'
data-ad-format='autorelaxed'></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
Here is a post that outline integrating Adsense with Ajax.
Basically I think you need to the adsense script to the header… and then in your repeater templates hold the:
<ins class='adsbygoogle'
style='display:block'
data-ad-client='ca-pub-XXXXXXX'
data-ad-slot='XXXXXXXXXXX'
data-ad-format='autorelaxed'></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
I’m really not sure though, can you try this?
it doesn’t work, the loading of the next page is stopped.
this code `<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>`
blocks the script to load the other post
Ok, that was just a guess.
Let me know if you figure this out. Im sure other users will find this good to know.
Cheers,
Voici la solution :
replace
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
by
<script>
(adsbygoogle = window.adsbygoogle || []).onload = function () {
[].forEach.call(document.getElementsByClassName('adsbygoogle'), function () {
adsbygoogle.push({})
})
}
</script>
Cheers