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)
-   -   How to place ads at top of category pages? (http://forum.bytesforall.com/showthread.php?t=488)

RuthSmith Feb 21, 2009 11:41 AM

How to place ads at top of category pages?
 
I would like to place a relevant ad at the top of each category page on my site. In theory, you would visit the category page and there would be a banner ad and then the content or most recent posts below. Each category page would have a different ad.

Much like what is being done on this site
http://www.bestgreenblogs.com/category/editors-choice/

Alternatively, is there a way to make each sidebar for each category different (for ad placement)? I've managed to have a static home page with a separate right side bar. Then all my other pages have the same right side bar.

Thanks!
Ruth

eta: Tim from best green blogs told me that he inserts the banners on a particular template page to make them show up correctly in Wordpress. Anyone know how to do this?

I see one category template in my cpanel files. WP Codex says to change looks of each category you can make separate category template files by copying original category template. So you'd have category template a, b, c, etc. But how to make it so these new category templates show up correctly or are being called correctly in then end? If that makes any sense?

Flynn Feb 22, 2009 04:57 AM

You could use the http://wordpress.org/extend/plugins/php-code-widget/ then use the enhanced text widgets that this plugin provides to put widgets with your ad code into a sidebar, with this content

PHP Code:

<?php if ( is_category('9') ) { ?>
AD CODE, i.e. Adsense, or Text, or HTML, or Javascript for this category
<?php ?>

You can use "if this is category XY" in different ways:

When the archive page for Category 9 is being displayed:
PHP Code:

  is_category('9'

When the archive page for the Category with Name "Cheddar Cheeses" is being displayed:
PHP Code:

is_category('Cheddar Cheese'

When the archive page for the Category with Category Slug "blue-cheese" is being displayed:
PHP Code:

is_category('blue-cheese'

When the archive page for the Category 9, or the Category with slug "blue-cheese", or the Category with the name "Cheddar Cheese" is being displayed:
PHP Code:

is_category(array(9,'blue-cheese','Cheddar Cheese')) 


RuthSmith Feb 25, 2009 11:44 AM

Thanks so much for the response. I'll digest and give it a try!

Flynn Feb 25, 2009 12:49 PM

RuthSmith, please check the above code again, I missed one { and added it now.


All times are GMT -6. The time now is 05:25 PM.

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