Archived topic
Adding adsense adds screws with my header size
10 replies · Started by Barry on July 22, 2018
I have been looking to add adsense to my website. I added the adsense code and selected the type of ads I wanted. However I noticed if I put a 'before content' banner add (so above the title of my blog post) then the size of my header increases and this makes my nav bar miss-aligned and sits below my logo..
Not sure why the ads are causing this since surely they are being inserted in a different div not the div for the nav bar?
I have removed the ads right now to see if there is a potential easy fix.
Hi there,
Not quite sure what you mean without seeing the problem live.
Any chance you can provide the link with the ad inserted?
You can edit the original topic and use the private URL field.
If I had to guess it's because the ad has fixed height inline style added to it.
I have added in the adsense again and added a link to one of the pages with the ads on it where the problem is happening. Thank you
I'm not seeing an ad before the content currently, but are you choosing the "Responsive" ad type? If not, choosing it will make the ad fit inside the container that it sites in.
I can see the add on my website on the page I have set to hidden on this thread. I have auto ads enabled through specific URLs and I am using Ad Inserter to insert the add before the content.
I see it now, although it doesn't appear to be in the before content hook. Did you move it?
Not sure what you mean exactly. I haven't moved anything. I have it set to 'before content' in the plugin I use called Ad Inserter.
Can you try the "Before Content" hook inside GP Hooks instead? I'm not sure how Ad Inserter knows where before the content is.
Sure thats me disabled ad inserter now and added my adsense code to the 'before content' GP hook.
Here's what I'm seeing: https://www.screencast.com/t/ZcmezewLA
It's not in the "Before Content" hook that comes with GP. Are you still using a plugin to insert the ads?
I have now deleted ad inserter (previously I disabled it) and cleared the cache. My adsense code is definitely inside the before content hook. Is that screenshot private?