• My theme is getting ready and while it works just fine without the widget, I’d tried to widgetize the sidebar with not much luck.
    Here’s the sidebar HTML code, file name sidebar.php:

    <div id="sidebar">
      <h3 class="sidebartitle"><?php _e('Categories'); ?></h3>
      	<ul class="sidebar">
        	<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
      	</ul>
      <h3 class="sidebartitle"><?php _e('Archives'); ?></h3>
        <ul class="sidebar">
          <?php wp_get_archives('type=monthly'); ?>
        </ul>
    </div>

    Following the direction on the subject at this page, the sidebar.php file looks like this:

    <div id="sidebar">
    <?php
    if (function_exists('dynamic_sidebar') && dynamic_sidebar('home_right_1')) :
    else :
    ?>
      <h3 class="sidebartitle"><?php _e('Categories'); ?></h3>
      	<ul class="sidebar">
        	<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
      	</ul>
      <h3 class="sidebartitle"><?php _e('Archives'); ?></h3>
        <ul class="sidebar">
          <?php wp_get_archives('type=monthly'); ?>
    <?php endif; ?>
        </ul>
    </div>

    The function.php file has this content:

    <?php function arphabet_widgets_init() {
    	register_sidebar( array(
    		'name' => 'Home right sidebar',
    		'id' => 'home_right_1',
    		'before_widget' => '<div>',
    		'after_widget' => '</div>',
    		'before_title' => '<h2 class="rounded">',
    		'after_title' => '</h2>',
    	) );
    }
    add_action( 'widgets_init', 'arphabet_widgets_init' );
    ?>

    In the admin control panel, I still get the error message of:

    No Sidebars Defined

    No matter how I try.

    It’s either the reference linked is wrong, or I didn’t follow it to the “tee”. Could someone tell me what I am doing wrong?
    TIA…

  • The topic ‘Widgetizing the sidebar…’ is closed to new replies.