• Resolved benromero

    (@benromero)


    On my website https://www.coolpack.com, I have turned on “header ads widget” in the theme options section.

    I then go to the widgets section, where the header area shows up. I then insert a widget for google adsense into it. After these steps, I never get to see the ad show up in the header – is there something wrong?

    Note that I have followed these steps to add google adsense into the sidebars without issue, it just does not seem to work for the header (note that I am using a Header Logo, not sure if this has an impact). Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi benromero. The theme is creating the header ads container but there isn’t anything in it. You said the sidebar ads were working. What’s different between the sidebar ad widget and the Header Ads widget?

    Thread Starter benromero

    (@benromero)

    Hello bdbrown, thanks for your help.

    Nothing is different between the Sidebar Ad Widget and header Ads widget (the same responsive ad unit is used actually, using the same google adsense plugin/widgets.

    I just checked your site again and now the header ads container has a widget in it:

    <div id=”header-ads”>
    <!– Quick Adsense WordPress Plugin: https://quicksense.net/ –>
    <div id=”adswidget7-quick-adsense” class=”widget ?lambda_63″>
    <script async=”” src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
    <!– Default –>
    <ins class=”adsbygoogle” style=”display:block” data-ad-client=”ca-pub-6222698684191548″ data-ad-slot=”3799043482″ data-ad-format=”auto” data-adsbygoogle-status=”done”></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    </div>
    </div>
    <!–/#header-ads–>
    </div>

    But it has a size of 0x0 so my guess would be there aren’t any ads to display. Developer Tools also shows this error:

    Uncaught Error: Cannot find a responsive size for a container of width=0px and data-ad-format=auto
    pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:54

    Thread Starter benromero

    (@benromero)

    Bdbrown – thanks again.

    I should have mentioned that, likely you did not see anything before because I had removed the widget since it wasnt working…I left it in there in case you checked again, but as you can see it is not working.

    It is a google adsense responsive ad unit…these seem to be working fine in the sidebars…

    any ideas as to what may be wrong and what I should try? maybe use a non responsive ad unit? (I was hoping to use a responsive ad unit so that I get an ad in the header no matter what the screen size is…however not sure how it would work with a phone or small screen)

    I don’t know anything about how the Adsense ads work so sorry I can’t help you there. But there must be something different about it or you would assume that it would work like the others. Maybe the responsive part is the difference.
    I can tell you that the theme, by default, will hide the header ads sidebar when the viewport reaches 1200px. This is so there will be room for the site title/logo and description in the header in mobile views. If you look at the theme file responsive.css you’ll see the code at the top of the file. You could override this with a media query in a child theme but you’d also have to work out what to do with the header ads container in the different mobile views since the default theme css doesn’t handle that.

    Thread Starter benromero

    (@benromero)

    bdbrown – thanks again for looking into this – I have tested other ‘set’ google ad units (not the default responsive type) and these work…so it must not like the responsive Google Ad units for some reason.

    Thanks again!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Header Ads not showing’ is closed to new replies.