0

My Widget Option is missing in the Dashboard area. How can i make that appear? I have downloaded this Blank Theme from Chris Coyiers site.

sidebar.php

<?php
/**
 * @package WordPress
 * @subpackage HTML5-Reset-WordPress-Theme
 * @since HTML5 Reset 2.0
 */
?>

<div class="sidebar">
  <?php if (!function_exists('dynamic_sidebar') && !dynamic_sidebar('Sidebar Widgets')) : else : ?>

  <!-- All this stuff in here only shows up if you DON'T have any widgets active in this zone -->

  <?php get_search_form(); ?>
  <h3>
    <?php _e('Archives','html5reset'); ?>
  </h3>
  <ul>
    <?php wp_get_archives('type=monthly'); ?>
  </ul>
  <h3>
    <?php _e('Meta','html5reset'); ?>
  </h3>
  <ul>
    <?php wp_register(); ?>
    <li>
      <?php wp_loginout(); ?>
    </li>
    <li><a href="http://wordpress.org/" title="<?php _e('Powered by WordPress, state-of-the-art semantic personal publishing platform.','html5reset'); ?>">
      <?php _e('WordPress','html5reset'); ?>
      </a></li>
    <?php wp_meta(); ?>
  </ul>
  <h3>
    <?php _e('Subscribe','html5reset'); ?>
  </h3>
  <ul>
    <li><a href="<?php bloginfo('rss2_url'); ?>">
      <?php _e('Entries (RSS)','html5reset'); ?>
      </a></li>
    <li><a href="<?php bloginfo('comments_rss2_url'); ?>">
      <?php _e('Comments (RSS)','html5reset'); ?>
      </a></li>
  </ul>
  <?php endif; ?>
</div>

the widget code in my functions.php

// Widgets
if ( !function_exists('register_sidebar' )) {
    function html5reset_widgets_init() {
        register_sidebar( array(
            'name'          => __( 'Sidebar Widgets', 'html5reset' ),
            'id'            => 'sidebar-primary',
            'before_widget' => '<aside id="%1$s" class="widget %2$s">',
            'after_widget'  => '</aside>',
            'before_title'  => '<h2 class="widget-title">',
            'after_title'   => '</h2>',
        ) );
    }
    add_action( 'widgets_init', 'html5reset_widgets_init' );
}
2

Put this lines of code in function.php

if (function_exists("register_sidebar")) {
register_sidebar();
}

Put this to sidebar.php

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<?php $image = new WP_query ('showposts=1');
if(have_posts()) : while($image->have_posts()) : $image->the_post; ?>

  <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to 
 <?php  the_title_attribute(); ?>"><?php postimage(); ?></a>

 <?php endwhile; endif; rewind_posts; ?>
1

I replaced this

// Widgets
if ( !function_exists('register_sidebar' )) {
function html5reset_widgets_init() {
    register_sidebar( array(
        'name'          => __( 'Sidebar Widgets', 'html5reset' ),
        'id'            => 'sidebar-primary',
        'before_widget' => '<aside id="%1$s" class="widget %2$s">',
        'after_widget'  => '</aside>',
        'before_title'  => '<h2 class="widget-title">',
        'after_title'   => '</h2>',
    ) );
}
add_action( 'widgets_init', 'html5reset_widgets_init' );

}

into this ..

// Widgets
if (function_exists('register_sidebar')) {
    register_sidebar(array(
        'name' => 'Sidebar Widgets',
        'id'   => 'sidebar-widgets',
        'description'   => 'These are widgets for the sidebar.',
        'before_widget' => '<aside id="%1$s" class="widget %2$s">',
        'after_widget'  => '</aside>',
        'before_title'  => '<h2>',
        'after_title'   => '</h2>'
    ));
}

Then the widget option came out..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.