[SOLVED] Remove AdSense From Just One Page
Great theme... I have been looking for something like this all my life! ...well, ok maybe just for the last couple of months. ;) But it is a great theme which I hope to get proficient with.
I have my adsense code in the center column... Style & edit CENTER COLUMN ... below the loop Works great but I need to NOT have adsense show on a certain page. Can you help me? I found a thread from last April regarding this, I think, but couldn't follow it. Can you tell me what code I need where? Thank you! P.S. I know HTML but am lost with PHP |
You can put PHP code into most text areas in the theme options
<?php if (!is_page('Page Title')) { ?> ADSENSE code here... <?php } ?> Page Title = Title of page where Adsense should not be displayed |
Beautiful! Works great! Thank you!
I noticed I can use page # instead of page title ...probably better. I also noticed it doesn't work in the sidebar text widget. Is that correct? I guess no big deal as I can just not show the sidebar for that page. Just wondering if I'm doing something wrong? |
The text widget doesn't accept PHP code, use the PHP code widget http://wordpress.org/extend/plugins/php-code-widget/
You can use the page name, the page slug (what the page uses in the url, e.g. mysite.com/the-page_title/) or the ID and even mix and match them when using several <?php if (!is_page(array('Page Title', 'other-page-title', 29))) { ?> ... <?php } ?> If you use the ID and export/import your content into another blog the ID's will most likely not match anymore on the new domain. On the other hand the PHP code will not work anymore if you change the post or page title and you used the title in the code. |
Thank you for the reply, Flynn. Truly appreciate it!
And I appreciate the theme... very nice! |
All times are GMT -6. The time now is 09:30 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.