Mostly about my amusement

Day: March 26, 2008 (page 1 of 1)

Widgetized my theme

In preparation of installing WordPress 2.5 I finally widgetized my theme. I’m using an old 2.0 version of FastTrack. Widgets have been around for a long time so as I play with 2.5 I figured I’d come up to speed with a 2.0 feature.

I had a bunch of nested if..thens so that the home page would show one sidebar and single posts and pages would show another. I had cleaned up the theme so I now had separated the two sidebars in the file.

In my theme’s function.php I added the following lines:

if ( function_exists(’register_sidebar’) )
register_sidebars(2,array(
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ‘<h2>’,
‘after_title’ => ‘</h2>’,
));

This let me define 2 sidebars, one for the home page and one for not the home page.

In my sidebar.php I placed

php code for the is_home() sidebar

<?php endif; ?>

<?php } else { ?>

<?php if ( !function_exists(’dynamic_sidebar’) || !dynamic_sidebar(2) ) : ?>

php code for the all other pages sidebar

<?php endif; ?>

<?php }?>

This let me have a default for each sidebar. That’s where I ran into a snag. I want to re-use the same widgets in both sidebars. The widgets won’t let me use them twice. I wanted to use the meta widget on the home page as well as on the single posts.

If I want I can define additional duplicate widgets but that’s a pain. I’m playing with the idea of defining a third dynamic sidebar and display that on the bottom of each sidebar.

I’ll keep playing with it to find a solution I like.

NY Autoshow

Picture of the family in front of the concept Jeep

Monday we took the kids to the NY Autoshow. The kids liked it and they came home exhausted.

It was like they turned Jacob Javits into one huge car dealership. There were very few concept cars. The cars were cool but I could have seen much of the same thing just by visiting the car dealers in my neighborhood.

The photo was from a promotional thing that Jeep was doing. They take your photo, you get it online and get exposed to way too much marketing material. I took pictures too and will probably upload them to Flickr.

The high point of the day was when the kids pulled off the center mirror on a Smart Car they were crawling over. After that I did not let them into the cars anymore.