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

XF 1.4 Trying not to show adsense where it don't belong

DieselMinded

Well-known member
#1
Code:
<xen:if is="!in_array({$contentTemplate}, array('message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'register_facebook', 'register_twitter', 'register_google', 'login', 'login_two_step', 'error_with_login', 'contact'))">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 2017MM -->
<ins class="adsbygoogle"
     style="display:block"
     XXXXXXXXX
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br />
</xen:if>
Im trying to hide one of my adsense ads from showing , specifically on the register page , the above code don't work what am i missing?
 

viper357

Active member
#3
Code:
<xen:if is="!in_array({$contentTemplate}, array('message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'register_facebook', 'register_twitter', 'register_google', 'login', 'login_two_step', 'error_with_login', 'contact'))">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 2017MM -->
<ins class="adsbygoogle"
     style="display:block"
     XXXXXXXXX
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br />
</xen:if>
Im trying to hide one of my adsense ads from showing , specifically on the register page , the above code don't work what am i missing?
My code is the same as yours, except I have it wrapped in the following, works for me.
<xen:if is="!{$visitor.user_id}">
xxxx
</xen:if>
 

DieselMinded

Well-known member
#4
Im already hiding the ads from certain groups with another addon, i just need to not show the ads on the pages they are not allowed , i wrap the ad code in the disallow code i posted in the first post but the ad still shows on the register page and not sure about the rest