Getting theme widget ready–
-
I’m attempting to get the second sidebar on the Gridfocus theme widget-ready, and studying from this forum post:
http://ww.wp.xz.cn/support/topic/114391?replies=42
and this guide:
http://automattic.com/code/widgets/themes/
If anyone can help me clarify exactly where to start / what to do I would really appreciate it!
One thing I’d like to say: the sidebar I want to widgetise isn’t called sidebar.php, it’s called second.php, is this a problem?? will I need to rename it and every other reference to it??
Like I said, I’d really appreciate some guidance on basic points of what I need to do here,
thanks!
Edit: link to grid focus theme
-
If more than one sidebar… take a look at these threads:
http://ww.wp.xz.cn/search/multiple+sidebars+widgets?forums=1Hey moshu, Thanks!
one question: does that matter if i only want to widgetise one of the sidebars?
Well, in that case you don’t have to worry about the code for multiple sidebars.
Cool man thanks.
ANy help on the original points would also be appreciated. Having no joy with it at all!
You already found all the necessary documentation for widgetizing.
Apply the widget call code to your sidebar file. Don’t forget to close the if statement.
Add a functions.php file to your theme (can copy from classic).
If you are using a second sidebar file, e.g. named mysidebar.php -> modify the functions.php code to reflect its name.
Call that custom sidebar with the proper include line:
<?php include (TEMPLATEPATH . '/mysidebar.php'); ?>
That’s it.Ok, so I’ve added code to the sidebar (second.php) to make it look like this
<div id="midCol"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> .....SIDEBAR CONTENT <?php endif; ?> </div>And added this to the top of functions.php in the wp-include folder:
<?php if ( function_exists('register_sidebar') ) register_sidebar(array( 'before_widget' => '', 'after_widget' => '', 'before_title' => '<div class="title">', 'after_title' => '</div>', )); ?>But in the admin panel it’s still not recognising the sidebar, although it looks ok.
Any ideas people?
<?php if ( function_exists('register_sidebar') ) register_sidebar(array('name'=>'second', 'before_widget' => '', 'after_widget' => '', 'before_title' => '<div class="title">', 'after_title' => '</div>', )); ?>Ahh so I shouldn’t be editing functions.php in the wp-include folder, but making a newbie in the actual theme folder, right?
Yes, nobody ever talked about the wp-include folder.
I explicitely told you:
Add a functions.php file to your theme (can copy from classic).I wrote that post before your reply came up, sorry. I stupidly assumed it was the other functions.php file.
Rule of thumb: don’t do anything until you are sure you got the latest reply and being sure you understood it π
Learned π
Ok the sidebar is now sidebar-conscious, thank you for all your help and understanding Moshu.
I will probably be back with another mad enquiry + learned patience! Thanks again bro.
Hello there… i’m with a similar problem….
Trying to read about but only getting more lost. I tried to read something on that API about widget… but i’m afraid i might die if continued….Here is the thing… i did make the first bar widgetized, but my theme has a total of four colums, the first/page content/and the others two.
And aparently the others two are in obar.php(nao-sapien theme). And now i have no idea what step to take…Where i put what??? and about the name thing? Please help me, and be patient. thank you
The topic ‘Getting theme widget ready–’ is closed to new replies.