Starting out, theming from scratch – widgets?
-
So, I just grabbed 2.6 and its the first time I’ve ever really dove into wordpress. I’ve done alot of other CMS coding before, but wordpress is a bit different.
I’d like to do a theme from scratch, so I can learn all the in’s and out’s, and was immediately curious about the widgetized sidebar.
I’m curious as to what makes a side bar widgetized. Is it simply the if check that looks for whether there is or isn’t the dynamic_sidebar function?
Sample from Default:
<?php /* Widgetized sidebar, if you have the plugin installed. */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
I’ve searched a few places around WP.org and I’m just not finding something that definitively answers this, and I’m sorry if you’ve answered this a hundred times, but I figured the community was probably the best place to go for this. Plus, I’m so new that I really have no clue at all for what to really search for.
Also, I’m curious, can you just not have a “sidebar” and still be able to drop plugins into an area per se? Like, if I wanted a div to be widgetized on the home page after the blog posts or something? Do I just drop the function check in a div and I’m done with it?
I’ve got a whole slew of questions, but I think if I get this answered, I’ll be able to have some better knowledge of what to search for and how this works.
Thanks a million, I’ve heard great things about this community, so thanks in advance.
Sincerely,
Ken Hanson
-
This would be a good read to get you started.
http://automattic.com/code/widgets/themes/
You can drag widgets into not only your sidebar but also other containers or DIVs. With a normal widget, it is quite standard to have a UL LI kind of structure, with a DIV it is slightly different. But that link kind of delivers an in depth explanation so take a look and hopefully your questions are answered. If not, feel free to ask.
Wow, thanks man! What a great link, perfectly answered my questions. Totally awesome, thanks again!
- The topic ‘Starting out, theming from scratch – widgets?’ is closed to new replies.