Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Turn off AdSense on certain pages (http://forum.bytesforall.com/showthread.php?t=1080)

Jerry Apr 3, 2009 09:09 AM

Turn off AdSense on certain pages
 
Hi,
I would like to turn off the adsense ads on a few pages- "about" "privicy policy" for example. You set me up with the code to get adsense on my "page" pages here Flynn. Is there a simple way of accomplishing this.:)

Flynn Apr 4, 2009 04:34 PM

In that code replace

PHP Code:

if ( is_single() OR is_page() ) { 



with

PHP Code:

if ( (is_single() OR is_page()) AND !is_page('About') AND !is_page('Privacy Policy') ) { 

Or to exclude many pages

PHP Code:

if ( (is_single() OR is_page()) AND 
!
is_page(array('About''Privacy Policy''25''119''some-page''another-page')) ) { 

In the last example I mixed page titles, page ID's and page names (= the URL part of a page when using Permalinks, i.e. mysite.com/blog/some-page/). All three methods of page identification (ID, title, name) can be used, and they can be mixed.



All times are GMT -6. The time now is 11:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.