views:

24

answers:

1

Hi,

I'm new to WordPress theming and have downloaded the Starker's WP theme from starkers

My question is, as this is an updated theme based on new twentyten for WordPress 3.0, do I need all the code in the functions.php file as it all seems to make reference to default twentyten theme?

I'm am doing a CMS and was wondering if there is any important code I need in this functions.php file?

Thanks.

+1  A: 

It depends on what stuff you are going to incorporate in your theme. You don't need that all unless you want.

The minimum you need is for sidebar integration, here is an example:

if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'before_widget' => '<div class="side">',
        'after_widget' => '</div></div>',
        'before_title' => '<div class="sidebar_title">',
        'after_title' => '</div><div class="side_content">',
));

This is usually helpful when you want to assign what should come before or after the sidebar.

For example, I created a theme using Starker's theme and here is all what is present in my functions.php file:

<?php
if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'before_widget' => '<div class="side">',
        'after_widget' => '</div></div>',
        'before_title' => '<div class="sidebar_title">',
        'after_title' => '</div><div class="side_content">',
    ));


// add thumbnail support to theme, options will be automatically visible in admin   
if (function_exists('add_theme_support')) add_theme_support( 'post-thumbnails' );

?>
Sarfraz
Thanks Sarfraz. I was just wondering, if possible, as I'm new to WordPress theming, would it be ok if I could pls email you directly with queries at times just to get my first theme out. Will contact you at your website if ok. Thanks.
tonsils