• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Google ad on Xenforo Gallery page issue

tommydamic68

Well-known member
#1
Its odd, the Google ad I have looks fine on all pages except Xenforo gallery page - any thoughts? It rolls right past my footer. 1st pic is a normal page second gallery page.


Screen Shot 2017-04-01 at 6.56.41 AM.png

GALLERY PAGE
Screen Shot 2017-04-01 at 6.56.14 AM.png
 

Chris D

XenForo developer
Staff member
#2
There are floated elements on the gallery pages so you need to add some additional CSS to the ad container. "clear: both;" should do it.
 

tommydamic68

Well-known member
#3
There are floated elements on the gallery pages so you need to add some additional CSS to the ad container. "clear: both;" should do it.
Thanks @Chris D - I added it like so, hopefully thats correct - it seemed to have worked, i'll share the code in case someone runs into the same issue.

Code:
<xen:hook name="ad_below_content" />
<div style="clear:both"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Matched ads -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-xxxxxxxxxxxx"
     data-ad-slot="xxxxxxxx"
     data-ad-format="autorelaxed"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>