Tagged: ,

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #202075

    Hi,
    I would like to ask if its possible to add the adsense code in between the post on front page,
    e.g
    After the 5th article and in between the last article and footer?

    http://www.unikorns.com/

    Thanks.

    • This topic was modified 10 months, 1 week ago by  edogpus.
    #202467

    Hi edogpus!

    You can edit index.php, find this code on line 191:

    else: 
    		
    			echo'<div class="entry">';
    			echo'<h2>'.__('Nothing Found','newscast').'</h2>';
    			echo'<p>'.__('Sorry, no posts matched your criteria','newscast').'</p>';
    			echo'</div>';
    			
     		endif;

    Echo out the adsense code below:

    echo 'GOOGLE AD SENSE CODE HERE';

    Best regards,
    Ismael

    #202799

    Hi,
    Thanks for the response, but the ad still wont show on posts.

    `else:

    echo’<div class=”entry”>’;
    echo’<h2>’.__(‘Nothing Found’,’newscast’).’</h2>’;
    echo’<p>’.__(‘Sorry, no posts matched your criteria’,’newscast’).’</p>’;
    echo’<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
    <!– Anuncio 9 –>
    <ins class=”adsbygoogle”
    style=”display:inline-block;width:300px;height:250px”
    data-ad-client=”ca-pub-3436410416385993″
    data-ad-slot=”4187836154″></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>’;
    echo’</div>’;

    endif;

    • This reply was modified 10 months, 1 week ago by  edogpus.
    #202818

    Hey!

    Place it at the bottom of line 198.

    endif;

    Regards,
    Ismael

    #204427

    Hi,

    I tried to insert this one below the `endif;

    echo’<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
    <!– Anuncio 9 –>
    <ins class=”adsbygoogle”
    style=”display:inline-block;width:300px;height:250px”
    data-ad-client=”ca-pub-3436410416385993″
    data-ad-slot=”4187836154″></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>’;

    After It the page won’t appear anymore, like a white screen only.

    #204450

    Hey!

    Please post your modified template by using a code service like: https://gist.github.com/ – we’ll check the syntax.

    Regards,
    Peter

    #205800
    This reply has been marked as private.
    #206141

    Hi!

    Please edit index.php, remove everything then replace it with this code: http://pastebin.com/7HTnThg3

    It should look like this:

    Cheers!
    Ismael

    #206283
    This reply has been marked as private.
Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Adding adsense in between posts’ is closed to new replies.