Click here to register or to donate.Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

[SOLVED] Specific content in logo area for a category

#1

Mar 25, 2009, 08:34 PM

paulae

1,333 posts · Feb 2009

Wordpress 3.4.1, Atahualpa 3.7.7

I am almost able to do this myself, but I'm not sure of the PHP quite yet. Flynn, you helped me make the logo area into 3 table cells so I could put a logo image there plus an ad. I actually turned it into 2 cells.

Now I need to be able to have a different banner ad show in the right table cell just on a certain category. I know I'd do an "if is catgory ()" sort of statement, but I'm not sure where to put it in the header config file. My file right now has this in it:

// Code for all other pages$logo_area .='<script language=javascript src="http://www.larchmontgazette.com/cgi-bin/csBanner2/csBanner.cgi?g=240&js=Y&ss=Y"></script>';}

$logo_area .='</td>';

#3

Mar 27, 2009, 02:20 PM

paulae

1,333 posts · Feb 2009

Wordpress 3.4.1, Atahualpa 3.7.7

Ah. Getting closer. I should have been clearer, Flynn. Sorry.

I need separate code for Obituaries and Garden Guide. Each of these categories will have a different sponsor. So I need 3 instances of the Javascript banner ad code, for Obituaries, Garden Guide and the rest of the site. I'm unsure of how to arrange the 2 versions of the code, plus the site-wide code.

// Code for all other pages$logo_area .='<script language=javascript src="http://www.larchmontgazette.com/cgi-bin/csBanner2/csBanner.cgi?g=240&js=Y&ss=Y"></script>';

}

$logo_area .='</td>';

#5

Mar 27, 2009, 08:39 PM

paulae

1,333 posts · Feb 2009

Wordpress 3.4.1, Atahualpa 3.7.7

OK, closer!

However, now the correct ads show on the category main page, but not on individual posts in the category. Ignore the funeral home ad in the right sidebar. That was my work-around if I couldn't get the top ad to work.

// Code for all other pages$logo_area .='<script language=javascript src="http://www.larchmontgazette.com/cgi-bin/csBanner2/csBanner.cgi?g=240&js=Y&ss=Y"></script>';

}

$logo_area .='</td>';

#7

Mar 28, 2009, 06:08 AM

paulae

1,333 posts · Feb 2009

Wordpress 3.4.1, Atahualpa 3.7.7

OK, that was the trick! Thank you so much, Flynn!

Why not make this an option in the theme options area? I would think many people would want to be able to use the logo area this way. Or have a separate ad banner spot up there, easily configurable for different sizes of logos and ads. The way I did it, with a TD spanning 2 columns for the logo and a TD for the ad works nicely. The refinement of letting the user show different ads in different categories is really super.

Maybe the person wouldn't put ads up there, just different kinds of images for different parts of his site.

Atahualpa is already so flexible, give us this added toy. Please?

For my part, I fear that the person who will eventually take over my job will not be as willing to get into the core files as I have been, so making this easy is important.