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 Code:
$logo_area .=<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : ?> |
Paulae,
you have 2 </script>'s at the end of the // Code for category Obituaries code |
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? |
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:
PHP Code:
|
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. |
Paulae,
I think you want to do something like this HTML Code:
if ( function_exists('dynamic_sidebar') && dynamic_sidebar(3) ) { |
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?
|
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
|
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. |
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) ) { |
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. |
All times are GMT -6. The time now is 03:54 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.