• Home
  • Archives
  • Contact Us

Updated :: Make Your Wordpress Themes Wigitized

Most of the themes available now a days are wigitized but there are a few really good ones that are not wigitized.In this tutorial I’ll show how you can wigitize a WP Theme, which can make it really easy to manage the sidebars of a WP Theme.

To check if your theme is widget ready or not just head to Design -> Widgets.

WP-no-widgets

Which means your theme is not widget enable.

Follow these steps to enable widgets for your theme.

  1. Create a file functions.php in your theme directory.
    <?php

    if ( function_exists('register_sidebar') )

        register_sidebar();

    ?>

    If you want 1 side bar

    [ OR ]

    <?phpif ( function_exists('register_sidebars') )register_sidebars(2);?>

    If you want multiple sidebars.You can replace 2 with any number.
  2. After doing that go to Design -> Widgets and you can find thisWP-widgets
  3. Now displaying the sidebars in your theme, open your sidebar.php present in your template theme, look for the unordered list like in the example below and add this text right after the <ul> tag.
    <?php if ( !function_exists('dynamic_sidebar')

         || !dynamic_sidebar() ) : ?>
  4. And finally close the if loop with the endif before the closing unordered list tag</ul>.<?php endif; ?>
  5. For example like this
<ul id="sidebar-right">

<?php if ( !function_exists('dynamic_sidebar')

     || !dynamic_sidebar() ) : ?>

                <li><h2>Categories</h2></li>

        <?php wp_list_categories(); ?>

    <?php endif; ?>

</ul>

NOTE : If you more than one sidebar, the you have to give the sidebar number in the function like this

    <?php if ( !function_exists('dynamic_sidebar')

         || !dynamic_sidebar(2) ) : ?>

Here the 2 is the sidebar number.If there is no number mentioned then the first sidebar is used.

UPDATE : Wigitize the footer

TechUpdates in the comments asked whether the footer can be wigitized.So here’s how we can wigitize the footer

Step 1: open the functions.php that we created above and add the following lines after the register_sidebar() or register_sidebars(2)

    register_sidebar(Array("name" => "bottomleft"));

    register_sidebar(Array("name" => "bottommiddle"));

    register_sidebar(Array("name" => "bottomright"));

for Example :

<?phpif ( function_exists(’register_sidebars’) )

register_sidebars(2);

register_sidebar(Array("name" => "bottomleft"));

register_sidebar(Array("name" => "bottommiddle"));

register_sidebar(Array("name" => "bottomright"));

?>

Step 2 :Open the theme folder and look for footer.php

          In the file look where the footer div block starts and add these lines

<?php if ( !function_exists(’dynamic_sidebar’)|| !dynamic_sidebar(’bottomleft’) ) : ?>

<?php endif; ?>

The footer div block would look start with something like this

<div class="footer-box">


If the footer has some functions by default, you can leave them as is.The wigets will replace the default.

For Ex.

<div class="footer-box">

<?php if ( !function_exists(’dynamic_sidebar’)|| !dynamic_sidebar(’bottommiddle’) ) : ?>

<ul>

<?php get_recent_comments(); ?>

</ul>

<?php endif; ?>

</div>

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Want automatic updates? Subscribe to our RSS feed or Get Updates From Tech Yard by Email
tag Digg This! tag Stumble it! tag Add to Del.icio.us tag Netscape it! tag Google Bookmark It!

Related Posts:
  • Weekend Wordpress Theme : SEO Green
  • Weekend Wordpress Theme - Daily32
  • Wordpress Weekend - Free WP Premium Theme
  • MassivePress - Free Wordpress Magazine Style Theme
  • 3 Free Wordpress Premium Themes
  • 2 Responses to: "Updated :: Make Your Wordpress Themes Wigitized"

    1. 1 Tech Updates
      Friday, July 4th, 2008 at 2:12 am

      Wow thats a excellent tutorial , world be useful when we need to use a theme which is real good but does not offer widgets. Also can we add widgets to footer files?

    2. 2 Venkat
      Friday, July 4th, 2008 at 11:11 am

      @Tech Updates: Thanks for the comments, I’ll try if we can wigitize the footer as well.


    Trackbacks/Pingbacks
    Posting your Comment!


    Join in on the conversation below!

    You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



    Add this blog to my Technorati Favorites!

    Enter your email address:

    Delivered by FeedBurner

    My Popular Posts

    • HotSpotSheild - Protect Your Computer In Public Wi-Fi HotSpots
    • High Quality Icons For Free Download
    • How To : Place Adsense After The First Post
    • JailBreak and Unlock Your iPhone 3G Using Pwnage Tool 2.0
    • 6 Ways To Create Heat Maps For Your Blogs
    • 3 Tools to permanently delete data from your drives
    • Get Out Of Sticky Situations By Calling Yourself
    • How To : Place Adsense in Blogger Blogs
    • emTube - Play YouTube Videos On Your Nokia N95
    • Download Norton Internet Security 2008 And Norton 360 For Free
  • RSS Guide To A Carrer Abroad

    • TOEFL : What & Who Needs To Give This Exam
    • GUIDE : How To Book Your GRE Slot
    • What Is GRE and TOEFL ?? Who Needs To Give These Exams
    • Visa Experiences
    • What To Expect On Your Way To USA ?
    • Visa Experience Fall 2008 May 20th
    • Visa Expericence May 22, 2008 Mumbai
    • Fall 2008 : Visa Experiences
    • What Are Emergency Slots ?? Availability and Who Qualifies For Them
    • Steps To Schedule A F1 Visa Interview
  • TECH YARD Copyright © 2008 | Disclaimer & Privacy Policy | Slick Blue Theme by Kyle Eslick