I am brand new to WordPress, but I'm trying to create my own theme. How's that for opening a can of worms?
Based on my online research, this exercise doesn't seem tremendously difficult. I'm an old software developer (no PHP experience), so most of the concepts are familiar to me.
My WP install is brand new, version 2.9.2, very few plugins installed and only one activated (my WishList Member membership plugin).
I'm nearly done with the core of my theme. The last step is to widgetize a couple spots, including one that's not in a sidebar. I've modified index.php and functions.php to do that.
Here's my funcions.php file (I hope the code tags work):
if ( function_exists('register_sidebar') )
'name' => 'Message',
'description' => 'This is a sample widget.',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
Kept it simple to test this out. As far as I can tell, there's nothing invalid about that code. WP throws no errors. Notice that I named my sample widgetized area "Message".
Here's what I put in my index.php file:
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Message') ) : ?>
<?php endif; ?>
The Widgets page shows my Message widget area just fine, and I can drag a Text widget over there and configure it. It seems to save without a hitch. But my page shows the "Not registered" message, which suggests that the widget never got registered properly somehow. When I put in some debugging statements, I can confirm that the dynamic_sidebar function exists, but this returns true:
I did a similar experiment with the same code in the default theme, and got the same results...widget appears in admin, but not on the page. So I don't think it's my custom theme that's causing a problem. It seems to be a problem with any theme.
Can anybody tell me what I'm doing wrong? Is there some kind of "don't display widgets even if they're there" setting that I'm missing?
Thanks for your help.