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, 10:19 AM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
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, 11: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, 11: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, 11: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, 11: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 11:54 AM.
  #6  
Old Jun 30, 2009, 04: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
  #7  
Old Jun 30, 2009, 08:54 PM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
What needs to go in there is the code to say "this is this new widget area," and doesn't that have to be some PHP code?
  #8  
Old Jul 1, 2009, 05:32 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
I think that is what you would be doing. $logo_area is all the HTML code that makes up the logo area. So you will be adding to that area. As an experiment, you could just add the garden club script there and see if it shows up in the third position. Good luck, I'll check back late Sunday
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Jul 1, 2009, 05:41 AM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
Have a great Fourth!

For when you get back: the "HTML that you want in there" doesn't make sense to me in this case. Aren't I just calling whatever widget is assigned to sidebar 3? What would I put between the '' after logo area?

In any case, I put in the most recent code you suggested and just left the area between the '' blank, and got the blank white page again. So I've reverted to what was working, and will wait to see what you think when you get back. We should all (Americans, that is) get outside and enjoy the beginning of summer. It's been more like early spring in the northeast.
  #10  
Old Jul 1, 2009, 06:02 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You could call the widget, but it would not be assigned as a value to $logo_area. You would have:
$logo_area .= my_new_function(my_option);
not
$logo_area .= 'my_new_function(my_option)';
this second one just adds that text to $logo_area. And if you did
$logo_area .= '<php my_new_function(my_option); ?>';
I'm pretty sure that this would try to run on the client side since it would be part of the generated page, instead of the server side WHILE you are generating the page.
Try this inplace of your red code below and see if you get three areas in the logo
HTML Code:
if ( function_exists('dynamic_sidebar') && dynamic_sidebar(3) ) {
$logo_area .= '<script language=javascript src="http://www.larchmontgazette.com/cgi-bin/csBanner2/csBanner.cgi?g=240&js=Y&ss=Y"></script>';
}
And yes it was a wet and cold July - We had a nice day yesterday, so I headed out for a ride on my Vesppa with a friend nad we headed to Hingham, MA. the closes we got to the ocean, the more clouds and the colder it got. We finally turned around and headed back inlane where it was a broiling 70 degrees. Have a safe and happy fourth
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #11  
Old Jul 3, 2009, 02:45 PM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
Thanks, JD. I'm too pooped and happy to dig into code now, so I'll re-read this later. Lovely day on Martha's Vineyard, even though it started out foggy at this end of the island and threatened to storm a bit. Turned out beautiful and warmer than it's been in a while. I spent what seemed like all morning bailing the rainwater out of my little sailboat, and gave up after I got it down at least to the sole. The handpump will work on the remaining water tomorrow, when I'll try my first race.

I'm not sure where Hingham is, but I hope you have good weather wherever you are, too.

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 09:59 PM
Using Query Posts plugin in non-widget area viewdesigninc Plugins & Atahualpa 8 Jun 19, 2009 03:03 PM
Background Images in Header Area dwbaylor Header configuration & styling 3 May 3, 2009 05:48 PM
HELP! How do I make the HEADER area transparent? Whatsthatcat? Header configuration & styling 1 Mar 30, 2009 06:07 PM
Advertising Banner in Header Area thinkentrepreneurship Header configuration & styling 0 Mar 18, 2009 03:06 PM


All times are GMT -6. The time now is 07:39 PM.


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