Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   [SOLVED] Remove AdSense From Just One Page (http://forum.bytesforall.com/showthread.php?t=3522)

whatever Sep 18, 2009 11:34 PM

[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

Flynn Sep 20, 2009 06:32 PM

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

whatever Sep 21, 2009 09:12 PM

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?

Flynn Sep 23, 2009 08:39 PM

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.

whatever Sep 23, 2009 09:32 PM

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 11:20 PM.

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