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 » Sidebars & Widgets »

New widget area in header


  #1  
Old Jun 30, 2009, 09:19 AM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
New widget area in header

I think I'm almost there. I've told functions.php that I want a third widget area. I want to place the code for it in the logo area, where at the moment I have a cgi script running. The area in red is what I want to change, to the new widget spot, where I intend to use another instance of Sponsors Slideshow widget in bfa_header_config.php:
Code:
	// END of title/description
$logo_area .='
    <td height=125 colspan="2" rowspan="2" valign="middle" class="header-banner">
        <a href="http://www.larchmontgazette.com"><img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/05/bluegazebo500x120.jpg" width=500 height=120 align=left border=0></a>
    </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=2&js=Y"></script>
</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=4&js=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>
';
When I placed
Code:
$logo_area .=<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : ?>
<?php endif; ?>;
there, I got a totally blank page. I must have somehow broken all the code on the page. I quickly put back the saved version of the file, and things are back to normal, but I really need to do this soon. I know Flynn is close to releasing a version of the theme that will have more widget areas, but I think the cgi script is really slowing down my site. http://www.larchmontgazette.com
  #2  
Old Jun 30, 2009, 10:00 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Paulae,
you have 2 </script>'s at the end of the // Code for category Obituaries code
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jun 30, 2009, 10:04 AM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
Hmmm. Funnily enough, it wasn't causing any problems before, and I swear I didn't touch that part this time.

Otherwise, do you think the php code about the widget should have worked?
  #4  
Old Jun 30, 2009, 10:38 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
The code you are adding is messing up. You are already in php so you are setting $logo_area to a value, but in this code

PHP Code:
$logo_area .=<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : ?>
<?php 
endif; ?>;
you are going back into PHP again. This causes the rest of the code in the program to get out of wack. I think you want to add quotes around the statement like this
PHP Code:
$logo_area .='<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : ?>'
endif;
of course I'm not sure what you are trying to do. This will just set the $logo_area to the string '<?php...' but I think you just want this to be another else if and then set $logo_area to what you want there.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Jun 30, 2009, 10:50 AM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
I am trying to use that spot as a widget area, in which I'll place an instance of Sponsors Slideshow widget, which provides a very nice fade effect between ads, and I think it will be less of a load-hog than the cgi Perl script running the 3 banners now.

I'm going to try it again with the code just as you show it.

UPDATE: Nope, that produced a totally blank page too. Thanks for your efforts; maybe I should just wait until the theme is ready for the widgets up there, and I can also upgrade the theme to whatever is current.

Last edited by paulae; Jun 30, 2009 at 10:54 AM.
  #6  
Old Jun 30, 2009, 03:03 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Paulae,

I think you want to do something like this
HTML Code:
if ( function_exists('dynamic_sidebar') && dynamic_sidebar(3) ) {
$logo_area .= '<what ever the html you want to use goes here>';
}
so if the dynamic_Sidebar function exists and there is a dynamic_sidebar (3) add this some code to the logo area.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I add a widget area inside the logo bar? jfriedman Header configuration & styling 8 Jun 26, 2011 08:59 PM
Using Query Posts plugin in non-widget area viewdesigninc Plugins & Atahualpa 8 Jun 19, 2009 02:03 PM
Background Images in Header Area dwbaylor Header configuration & styling 3 May 3, 2009 04:48 PM
HELP! How do I make the HEADER area transparent? Whatsthatcat? Header configuration & styling 1 Mar 30, 2009 05:07 PM
Advertising Banner in Header Area thinkentrepreneurship Header configuration & styling 0 Mar 18, 2009 02:06 PM


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


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