Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

[SOLVED] Specific content in logo area for a category


  #1  
Old Mar 25, 2009, 09:34 PM
paulae's Avatar
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:
// END of title/description
$logo_area .='
    <td colspan="2" rowspan="2" valign="middle" class="header-banner">
        <img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/gazebologopj1.jpg" align=left width=600 height=150>
    </td>
    <td rowspan="2" align="right" class="header-banner">
    <script language=javascript src="http://www.larchmontgazette.com/cgi-bin/csBanner2/csBanner.cgi?g=240&js=Y&ss=Y"></script>
    </td>
';
I want to have a different csBanner ad where the code in red is, on my Obituaries and Garden Guide category posts.

The obits page in action now shows a funeral home ad, the sponsor of the section, in the right sidebar, but I want to put a smaller version of it where the Sotheby's/Plates/Coughlin ads are now.

http://larchmontgazette.com/wp27/category/obits/
  #2  
Old Mar 26, 2009, 04:53 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
PHP Code:
// END of title/description
$logo_area .='
    <td colspan="2" rowspan="2" valign="middle" class="header-banner">
        <img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/gazebologopj1.jpg" align=left width=600 height=150>
    </td>
    <td rowspan="2" align="right" class="header-banner">'
;

if ( 
is_category('......') OR is_category('.....') ) {

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

} else {

// 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  
Old Mar 27, 2009, 03:20 PM
paulae's Avatar
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.

Should it be this?

Code:
// END of title/description
$logo_area .='
    <td colspan="2" rowspan="2" valign="middle" class="header-banner">
        <img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/gazebologopj1.jpg" align=left width=600 height=150>
    </td>
    <td rowspan="2" align="right" class="header-banner">';

if ( is_category('15')  ) {

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

OR is_category('16') ) {

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

} else {

// 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>
';
  #4  
Old Mar 27, 2009, 08:14 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Then use this:

PHP Code:
// END of title/description
$logo_area .='
    <td colspan="2" rowspan="2" valign="middle" class="header-banner">
        <img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/gazebologopj1.jpg" align=left width=600 height=150>
    </td>
    <td rowspan="2" align="right" class="header-banner">'
;

if ( 
is_category('Obituaries') ) { 

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

} elseif ( 
is_category('Garden Guide') ) { 

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

} else {

// 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  
Old Mar 27, 2009, 09:39 PM
paulae's Avatar
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.

http://larchmontgazette.com/wp27/category/obits/ , great!

But:

http://larchmontgazette.com/wp27/200...ind-reigelman/

There must be some other bit of code missing, no?
  #6  
Old Mar 27, 2009, 10:54 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Try this:

PHP Code:
// END of title/description
$logo_area .='
    <td colspan="2" rowspan="2" valign="middle" class="header-banner">
        <img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/03/gazebologopj1.jpg" align=left width=600 height=150>
    </td>
    <td rowspan="2" align="right" class="header-banner">'
;

if ( 
is_category('Obituaries') OR ( is_single() AND in_category('Obituaries') ) ) { 

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

} elseif ( 
is_category('Garden Guide') OR ( is_single() AND in_category('Garden Guide') ) ) { 

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

} else {

// 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  
Old Mar 28, 2009, 07:08 AM
paulae's Avatar
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.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Banner ad in top bar or logo area? paulae Header configuration & styling 28 Mar 21, 2011 03:17 PM
change the color of the space outside of the content area fcitino Atahualpa 3 Wordpress theme 13 Nov 16, 2009 07:46 AM
Full Post Text on specific category pages spencer Atahualpa 3 Wordpress theme 1 Jul 7, 2009 03:47 PM
How to Switch the Logo Area and Header Image tim5046 Header configuration & styling 1 Jun 2, 2009 01:43 PM
Can I make room for more content in the header area DoverTim Header configuration & styling 2 Apr 5, 2009 01:55 PM


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


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