仪表板区域中缺少我的小部件选项。我怎样才能让它出现?我从Chris Coyiers下载了这个空白主题site.
侧栏。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>
我的函数中的小部件代码。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\' );
}
SO网友:Jeremi Liwanag
我换了这个
// 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\' );
}
进入这个。。
// 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>\'
));
}
然后,小部件选项出现了。。