blank spaces between posts – ADSENSE

  • Arlindovsky


    I have a bar in the top adsense content and two adsense rectangles on the front page of the blog side by side. I have assets to show adsense ad, but did not want white space from the second to the third post and for the third to fourth post. How do I delete these blanks?


    Kenneth John Odle


    This is not a theme issue. By default, Google will display a maximum of three ads on a website, since they want their ads as high up as possible. If you include the code in more than three places, they will only feed ads to the first three. Any others will be ignored.



    But i’ve include only the adsense code in the adsense options on graphene options.

    Automatically graphene prepared 3 spaces for adsense, but i have already used the 3 adsense before the transitions to the 3rd and the 4th post


    Kenneth John Odle


    Yes, when you use Graphene’s Google adsense option, it will automatically prepare three spaces for where Google is going to insert ads, and it will prepare those places just after the first three posts.

    However, you are already using one in what I presume is an action hook widget area, and then you are inserting two ads in a space meant for one. That’s a total of three, hence the latter two are left empty. Graphene’s default adsense setup is not really designed to accomodate adsense in the way you are using it.

    All is not lost, however. Try adding this to your custom css or child theme css:

    #adsense-ad-2, adsense-ad-3 {display:none;}


    Syahir Hakim


    If you’re using a child theme, you can limit the number of ads that the theme displays. Place this code in your child theme’s functions.php file:

    function my_graphene_ads_limit(){
    return 1;
    add_filter( 'graphene_adsense_ads_limit', 'my_graphene_ads_limit' );



    Thanks a lot Syahir.

    Kenneth, when I used this code only disappeared in the blank from the 2nd to the 3rd post but kept the space from the 3rd to the 4th post.


    Kenneth John Odle


    Mea culpa. The code should have been:

    #adsense-ad-2, #adsense-ad-3 {display:none;}

    I missed the second # ID marker. Add that in and it should be good.



    Ok. Thanks Kenneth.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!