Nov
30
Tagged with (, , , ) by Meredith on 30-11-2006

This will probably not be of interest to anyone who isn’t into PHP, WordPress, and/or Sidebar Widgets.

I am having bizarre results trying to widgetize my design. The biggest concern I have is that I need the widget title to be outside the $before_widget code. I figured out how to do this by altering widgets.php and rearranging the order to be $before_title, $title, $after_title, $before_widget - but this is not an ideal solution, for a few reasons. First of all, it means I’m messing with stuff that wasn’t designed to be messed with by the likes of me! It means I’m slightly changing the code of the widget authors, and I don’t want to to do that. I would be just fine with only using text-input widgets that run PHP, because then I could just copy the code directly from the existing sidebar rather than fussing with various types of widgets.

I want to widgetize my design (which is originally an open-source design by Christopher Ditto, but I have modified it a lot, so I’m calling it my design) for a couple of reasons. First, I don’t like having the second sidebar’s code buried in the footer. Second, there are great big chunks of tables and whatnot that come before and after each section, to make the pretty little boxes with the funky corners, and I’d like to not have to look at that every time I want to edit my code. I suppose I could do it by using includes…I’ll have to give that a try, it will at least get things more tidy if I can’t actually use the widget functions.

I got the sidebars installed and working - I figured out how to have two of them, etc. - but in addition to not placing the title where I want it, the boxes are just coming out wrong. I don’t know if this is a result of the default code on each widget, or what - but I’m getting repeated top corners, lines extending too far, and other weird stuff that shouldn’t be happening, since I’ve pulled the before/after code straight from the existing sidebar, which works fine.

And this is totally weird. While I was messing around with widgets.php, a little “www” appeared in the upper left corner of both my design and the WordPress admin screens. I have no idea where it came from or why it was there. When I went back to a clean, unedited copy of widgets.php, it went away. I was also experiencing failures in functions.php whenever the Sidebar Widgets plugin was deactivated - I had to rename functions.php to something else just so I could use the admin side. Additionally, there were gaps between the section titles and the boxes - I don’t know where those came from, but I wouldn’t be surprised if it was related to whatever was making the boxes come out funny.

I seem to remember seeing someone who offered to widgetize any theme, for a fee. Part of me wants to do it myself, but part of me is so clueless about how to fix these errors that I’m considering passing it off to someone. I can’t figure out what site offered it, though, so for now I’m stuck doing it myself.

Post a Comment
Name:
Email:
Website:
Comments: