Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi espace69.
    What is the issue you are having?

    Cheers,

    Thread Starter espace69

    (@espace69)

    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>
    Plugin Author Darren Cooney

    (@dcooney)

    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?

    Thread Starter espace69

    (@espace69)

    it doesn’t work, the loading of the next page is stopped.

    Thread Starter espace69

    (@espace69)

    this code `<script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>`

    blocks the script to load the other post

    Plugin Author Darren Cooney

    (@dcooney)

    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,

    Thread Starter espace69

    (@espace69)

    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

    Thread Starter espace69

    (@espace69)

    resolved

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Adsense’ is closed to new replies.