Widgetizing my theme
-
I’m using the sodelicious-black-10 theme and it’s not “widgetized” I read this thread http://automattic.com/code/widgets/themes/ and still don’t get it. What do I need to do to get this widgetized.
Thanks.
-
Well it’s pretty straightforward. You just add the code that Matt clearly provided inside the sidebar, where indicated. He also advises using h2 instead of h3 or some other class to style sidebar headings.
And he provides the code that should go into a new file called functions.php.
What is so difficult about this?
So, basically I have to add everything he posted? I just didn’t wanna screw anything up. I know, I got to backup, I always backup first.
The only file you will be editing is
sidebar.php. And you’ll be creating a new file,functions.php. That’s it. Just rename the original filesidebar.php.origor something before you go performing surgery on it. πSee, that’s the thing that confused me, I already have a functions.php. Erase that one and make the new one?
Can you cut and paste the contents of that file here?
Be sure to use a backtick (to the left of the 1/! key) before and after the code.
How much text is in that file?
Or email me off list (check my profile) and I can help you with it. π
<?php function getWords($text, $limit) { $array = explode(" ", $text, $limit+1); if (count($array) > $limit) { unset($array[$limit]); } return implode(" ", $array); } ?>Not much in it, I’m sure It’ll screw something up if I delete it.
Leave what’s there alone. Just at the top, AFTER the top
<?phpadd this:
if ( function_exists('register_sidebar') ) register_sidebar();You’re just adding another function. π
Thank you so much for your time and patience. BTW, I like your site, you do some nice work. I was going to gmail you for help, again, thanks. π
No problem. And if you get stuck, just holler! π
The topic ‘Widgetizing my theme’ is closed to new replies.