-
AuthorPosts
-
October 16, 2017 at 10:35 am #864739
Hello, I would like to add widget area to header for AdSense ads. I’ve tried solution explained here, but they doesn’t work
https://kriesi.at/support/topic/adding-a-widget-area-to-the-header-6/
https://kriesi.at/support/topic/adding-a-header-widget-to-the-logo-container/
https://kriesi.at/support/topic/add-widget-area-to-header/Site – https://bitblog.tech
October 16, 2017 at 2:24 pm #864819October 16, 2017 at 2:33 pm #864822Hi Ricard, sorry for vague description :-)
I expected to see AdSense banner in the header just right of the logo. I have Header widget area created, and code inserted, however banner is not showingOctober 17, 2017 at 5:38 am #865113Hi,
Ok, thanks for the feedback. The adsense markup is added on the page, but I can’t see any ads either. I think that is something you will have to bring up with Google unfortunately, it’s out of our control.
Best regards,
Rikard- This reply was modified 7 years, 1 month ago by Rikard.
October 17, 2017 at 12:23 pm #865255Hi Rikard,
What I see in console: “adsbygoogle.push() error: No slot size for availableWidth=0”
So it seems that header is too small for banner, however I set manual height to 150, and I have no idea how to setup width. It seems there are plenty of space. Can this CSS be affecting it?#header .widget {
left: 50%;
padding-top: 0;
position: absolute;
top: 0;
transform: translate(-50%);
z-index: 999;
}October 18, 2017 at 7:37 am #865561Hi,
I can see that too, but I don’t really know what it means. Maybe you could try searching for the problem? Here’s a topic which might be of interest to you: https://stackoverflow.com/questions/33465168/google-adsense-error-tagerror-adsbygoogle-push-error-no-slot-size-for-avail
Best regards,
RikardOctober 19, 2017 at 12:18 am #865997Yes, I researched this topic already, but no luck. Still getting the same error.
I think that there is something wrong with the way I created header widget areaOctober 20, 2017 at 5:50 am #866568Hi,
If you think that there is something wrong with the widget, then maybe you could try to use the add code somewhere else to see if it works there? You could also add it to your header.php file to see if it work better if you add it directly to the template file.
Best regards,
RikardOctober 23, 2017 at 2:31 pm #867621hi Rikard,
Yes, it works by adding code to header.php, could you please help me to find a place in the file for the code? Currently when I put the code, ad shows either above all header or as a background image. I would like to have it on the right side from logo, is it possible?
October 23, 2017 at 4:20 pm #867678Hi vadikcoma,
Can you show us what you’ve got so far? Maybe it can be adjusted via css? Just don’t have it as a background.
Best regards,
VictoriaNovember 7, 2017 at 11:01 pm #873920Hi Victoria,
Sorry for long reply, I got totally stuck with this. I’ve removed all code that I changed, just to make sure I don’t mess things up.
I’m still interested in adding banner to header area, next to logo. But I wish there could be a better way :-)November 10, 2017 at 5:12 am #874968Hi,
We need access to the Appearance > Editor panel. Where did you add the widget? Please provide the adsense code.
Best regards,
IsmaelNovember 14, 2017 at 11:11 pm #876846Hi Ismael,
File editing has been enabled, sorry for trouble
Code in private attachmentNovember 16, 2017 at 5:53 am #877371Hi,
Did you add the code yet? I didn’t see it in the functions.php file so I added the filter but it broke the site. Where did you add the code? Please get a fresh copy of the functions.php file and override the current one.
Best regards,
IsmaelNovember 16, 2017 at 12:09 pm #877461hi Ismael, I fixed the 500 error by reuploading the theme, now all functions.php should be reset to default
November 17, 2017 at 6:24 am #877948Hi,
I’m very sorry for this. The hook that I added broke the site again. Did you add the hook somewhere else? I tested the same hook in my installation and it’s working just fine. Please post the FTP details in the private field so that we can revert the files in case we break something. Again, I’m very sorry for the inconvenience.
Best regards,
IsmaelNovember 17, 2017 at 2:03 pm #878057Hi Ismael, sorry for the mess, I had an Custom Functions Plugin installed, that was the reason for this. I’ve disabled it now.
November 18, 2017 at 9:09 am #878421Hi,
The adsense is working now. Please adjust the size and position of the widget in the Quick CSS field.
#header .textwidget { width: 600px; height: 90px; display: block; }
Adjust the values as needed.
Best regards,
IsmaelNovember 20, 2017 at 4:38 pm #879209Hello Ismael, thank you very much!
Can you advise me on how to place banner into header completely? Now it seems to be in the middle between header and body
I’ve added CSS here – https://bitblog.tech/wp-admin/themes.php?page=simple-custom-css.php but it doest seem to do anything
November 21, 2017 at 5:14 am #879482Hi,
We modified the css code a bit.
#header .textwidget { width: 600px; height: 10px; display: block; position: absolute; top: -50px; left: -100px; }
Best regards,
IsmaelNovember 21, 2017 at 12:37 pm #879683Perfect! Thank you very much! Please consider this as closed.
November 22, 2017 at 5:37 am #880053 -
AuthorPosts
- The topic ‘Add widget area to header’ is closed to new replies.