Responsive header ads doen't work
-
Tried to add google responsive ad to header but it doesn’t work. It says not enough space.
WordPress 4.5
Hueman 3.0.10
-
Hi msfndotorg. Welcome to the Hueman forum. Can you post a link to your site? Thanks.
Thanks bdbrown. Sure, it is http://www.msfn.org.
I just inspected source and it says:
Uncaught TagError: adsbygoogle.push() error: No slot size for availableWidth=0
The header ads container should expand automatically to accommodate the ad. How long have you had the ad code in there?
Since yesterday. It worked with Hueman v2. Static size ad works witout problem.
Chrome Inspect says this:
Uncaught TagError: adsbygoogle.push() error: No slot size for availableWidth=0 count.js:7 Uncaught TypeError: Cannot read property 'split' of undefinedTried to add google responsive ad to header but it doesn’t work
That’s what you posted 3 hours ago. And now you’re saying it was working yesterday in v2? So did you just try to add it after upgrading t0 v3.0.10, or was it working and stopped when you upgraded?
I just upgraded to 3.0.11 and yes it stopped showing up after upgrade to version 3. Doesn’t work because of theme css but i can’t figure it out.
https://ww.wp.xz.cn/support/topic/adsbygooglepush-error-no-slot-size-for-availablewidth0-blank-ads-solution?replies=1
http://stackoverflow.com/questions/33096300/max-width-not-working-for-div-created-for-google-adsense-ad
http://www.slideshare.net/prowebguru/solution-to-uncaught-tag-error-in-google-adsense-advertisementIn fact it is known problem.
Figured it out.
Just add this to your child theme custom css
@media only screen and (max-width:3000px) { #header-ads { width: 800px; height: 90px; } }Adapt to your theme. Adsense need to know exact width.
Btw, still issues, ads doesn’t show on mobile.
In fact it is known problem.
That’s interesting; hasn’t been an issue with the theme in the past.
ads doesn’t show on mobile.
That’s because they’re hidden on mobile views to save space. This in the CSS in responsive.css:
@media only screen and (max-width: 1200px) { #header-ads { display: none; } }Thanks bdbrown.
To keep header-ads widgets on mobile/smaller screens, just add this code to your custom CSS
@media only screen and (max-width: 1200px) { #header-ads { display: block !important; } }Thanks MrMountain!
The topic ‘Responsive header ads doen't work’ is closed to new replies.
