Я создаю новую тему Wordpress. Он работает, но не показывает панель виджетов в панели администратора. Вот мой код:Новая тема Wordpress не показывает виджетов в области администратора
<?php get_header(); ?>
<div class="wrapper">
<!--Navigation start-->
<div class="navigation_content">
<nav>
<ul>
<?php $args = array(
'depth' => 0,
'sort_column' => 'menu_order, post_title',
'menu_class' => 'menu',
'include' => '',
'exclude' => '',
'echo' => true,
'show_home' => true,
'link_before' => '',
'link_after' => '');
?>
<li class=""><?php wp_page_menu($args); ?></li>
</ul>
</nav>
</div>
<!--Navigation start-->
<!-- body content start-->
<div class="body_content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!--end post header-->
<div class="entry clear">
<?php if (function_exists('add_theme_support')) the_post_thumbnail(); ?>
<p><?php the_content(); ?></p>
<?php //edit_post_link(); ?>
<?php wp_link_pages(); ?>
</div><!--end entry-->
</div><!--end post-->
<?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
<?php else : ?>
<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
И вот мой код функции файл регистрации виджетов:
function ccp_widgets_init() {
register_sidebar(array(
'name' => __('Main Widget Area', 'ccp'),
'id' => 'sidebar-1',
'description' => __('Appears in the footer section of the site.', 'ccp'),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
));
я упускаю код?
Благодаря
ли вы регистрируете виджет в functions.php? – saifur
@Saifur: ya sidebar.php уже создано –
Вы зарегистрировали виджет в functions.php? – saifur