1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do I widgetize my blog's sidebar?

Discussion in 'WordPress' started by udoitnow, Jan 3, 2009.

  1. #1
    Hello,

    I hope I'm posting this in the right place, but I downloaded a Wordpress theme and in the description he said it was widgetized. I tried to drag and drop the widgets, but they don't show up on the theme. It appears that the sidebar is hardcoded. Although the widgets are there, they don't work. How can I fix this? Any help would be appreciated :confused:

    Thanks!
     
    udoitnow, Jan 3, 2009 IP
  2. conradmiguel

    conradmiguel Peon

    Messages:
    182
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Wordpress.org offers sufficient whitepaper for that. Try to read it, it's worth it!
     
    conradmiguel, Jan 3, 2009 IP
  3. udoitnow

    udoitnow Member

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Thanks conradmiguel. I've already done that. I'm not that tech savvy and most of what I read didn't make sense to me.

    Thanks anyway.
     
    udoitnow, Jan 3, 2009 IP
  4. sampathsl

    sampathsl Guest

    Messages:
    861
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    what are the widgets associated with the sidebar? I'll try to give a help. Please describe the problem.
     
    sampathsl, Jan 3, 2009 IP
  5. udoitnow

    udoitnow Member

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    Thanks sampathsl!

    When I drag and drop widgets in the sidebar, nothing happens. Although it says that this template is widgetized, the widgets don't work. For instance, when I drag and drop Catergories, Recent Post, etc. they don't show up. Then I drag a text box in, put my code in for the ad, and it doesn't show up. Also, there are 2 side bars.
     
    udoitnow, Jan 3, 2009 IP
  6. sampathsl

    sampathsl Guest

    Messages:
    861
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    This might not be widgetized that's why you don't see the widgets you add there. Make a backup of the theme and widgetize the theme you have. If you've got question post it here. However please check do you see following code in the functions.php?

    <?php
    if ( function_exists(’register_sidebar’) )
    register_sidebar();
    ?>
     
    sampathsl, Jan 3, 2009 IP
  7. udoitnow

    udoitnow Member

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #7
    That's just it...I DON'T know how to widgetize the blog. The question I'm asking is, how do I widgetize the blog. I've already read the stuff over at WP.org, but they make everything so complex.

    Thanks again!!
     
    udoitnow, Jan 3, 2009 IP
  8. sampathsl

    sampathsl Guest

    Messages:
    861
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Its easy. Please first check the functions.php file and the code I showed in my previous post. Do you find that code?
     
    sampathsl, Jan 3, 2009 IP
  9. udoitnow

    udoitnow Member

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #9
    Remember I have 2 sidebars. But this is the code I see:

    <?php
    if ( function_exists('register_sidebars') )
    register_sidebars(2,array(
    'before_widget' => '',
    'after_widget' => '',
    'before_title' => '<h2>',
    'after_title' => '</h2>',
    ));
     
    udoitnow, Jan 3, 2009 IP
  10. sampathsl

    sampathsl Guest

    Messages:
    861
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #10
    ok. now please check the each side bar.
    can you find this code in each side bars?

    <?php if ( !function_exists(’dynamic_sidebar’)
     
    sampathsl, Jan 3, 2009 IP
  11. udoitnow

    udoitnow Member

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #11
    In the theme editor there is only one sidebar.php Here is the code:

    <div id="sidebar1">

    <ul>




    <!-- list of categories, -->
    <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>

    <!--static pages with automatic headline 'pages'-->
    <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>


    <!--archives ordered per month-->
    <li><h2>Archives</h2>
    <ul>
    <?php wp_get_archives('type=monthly'); ?>
    </ul>
    </li>


    <li><h2>Meta</h2>
    <ul>
    <?php wp_register(); ?>
    <li><?php wp_loginout(); ?></li>
    <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
    <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    <li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
    <?php wp_meta(); ?>
    </ul>
    </li>




    </ul>

    </div>


    <div id="sidebar2">

    <ul>




    <!-- list of categories, -->
    <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>

    <!--static pages with automatic headline 'pages'-->
    <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>


    <!--archives ordered per month-->
    <li><h2>Archives</h2>
    <ul>
    <?php wp_get_archives('type=monthly'); ?>
    </ul>
    </li>


    <li><h2>Meta</h2>
    <ul>
    <?php wp_register(); ?>
    <li><?php wp_loginout(); ?></li>
    <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
    <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    <li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
    <?php wp_meta(); ?>
    </ul>
    </li>




    </ul>







    </ul>

    </div>
     
    udoitnow, Jan 3, 2009 IP
  12. sampathsl

    sampathsl Guest

    Messages:
    861
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #12
    yes widgets should not work. Functions have be inside this if statement
    <?php if ( !function_exists(’dynamic_sidebar’)

    // example : if you want to show archives
    <h1><?php _e(’Archives’); ?></h1>
    <ul><?php wp_get_archives(’type=monthly’); ?></ul>

    //example : if you want to show categories
    <h1><?php _e(’Categories’); ?></h1>
    <ul><?php list_cats() ?></ul>

    <?php endif; ?>

    try to adjust the code as this.
     
    sampathsl, Jan 3, 2009 IP
  13. udoitnow

    udoitnow Member

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #13
    I'm still having problems widgetizing my sidebars. Can someone please HELP!

    Thanks!
     
    udoitnow, Jan 4, 2009 IP
  14. techie007

    techie007 Peon

    Messages:
    261
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #14
    techie007, Jan 4, 2009 IP
  15. udoitnow

    udoitnow Member

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #15
    Thanks techie007...

    I found your blog the other night and followed your instructions, but it still didn't work. Below is the exact code for both my functions.php and sidebar.php

    Sidebar.php

    <div id="sidebar1">

    <ul>
    <?php if ( function_exists(’dynamic_sidebar’) && dynamic_sidebar(1) ) : else : ?>


    <!-- list of categories, -->
    <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>

    <!--static pages with automatic headline 'pages'-->
    <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>


    <!--archives ordered per month-->
    <li><h2>Archives</h2>
    <ul>
    <?php wp_get_archives('type=monthly'); ?>
    </ul>
    </li>


    <li><h2>Meta</h2>
    <ul>
    <?php wp_register(); ?>
    <li><?php wp_loginout(); ?></li>
    <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
    <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    <li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
    <?php wp_meta(); ?>
    </ul>
    </li>


    <?php endif; ?>

    </ul>



    </div>


    <div id="sidebar2">

    <ul>

    <?php if ( function_exists(’dynamic_sidebar’) && dynamic_sidebar(2) ) : else : ?>



    <!-- list of categories, -->
    <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>

    <!--static pages with automatic headline 'pages'-->
    <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>


    <!--archives ordered per month-->
    <li><h2>Archives</h2>
    <ul>
    <?php wp_get_archives('type=monthly'); ?>
    </ul>
    </li>


    <li><h2>Meta</h2>
    <ul>
    <?php wp_register(); ?>
    <li><?php wp_loginout(); ?></li>
    <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
    <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    <li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
    <?php wp_meta(); ?>
    </ul>
    </li>


    <?php endif; ?>


    </ul>







    </ul>


    </div>

    functions.php

    <?php
    if ( function_exists('register_sidebars') )
    register_sidebars(2,array(
    'before_widget' => '',
    'after_widget' => '',
    'before_title' => '<h2>',
    'after_title' => '</h2>',
    ));
    ?>

    Maybe someone can help me get this right.
     
    udoitnow, Jan 4, 2009 IP
  16. techie007

    techie007 Peon

    Messages:
    261
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #16
    The blog was not mine.. so i will not take the credit of it.. i just searched it for you on google... Below information would be useful..

    Version of wordpress
    Have you installed any custom theme

    If it is not a live site then you can give me the details to access the admin section of your wordpress and I will try to fix it.

    Thanks,
     
    techie007, Jan 5, 2009 IP