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

DieselMinded

Well-known member
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?
 
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>
 
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
 
Back
Top Bottom