У меня есть сайт WordPress с боковой панелью, оформленной в стиле темы, которую я скачал.
В разделе «Внешний вид»> «Меню» я создал новое меню, затем я установил раскрывающийся список меню боковой панели во вновь созданное меню, однако, когда вы переходите на веб-сайт, это не имеет значения ... старое меню все еще там ...
Итак, я посмотрел на редактор кода из темы и не могу понять, как изменить его, чтобы он работал из моего недавно созданного меню, я надеюсь, что кто-то сможет мне помочь. это код sidebar.php и боковая панель-init.php
боковая панель-init.php
<?php
function elegance_widgets_init() {
// Header Widget
// Location: right after the navigation
register_sidebar(array(
'name' => 'Header',
'id' => 'header-sidebar',
'description' => __( 'Located at the top of pages.'),
'before_widget' => '<div id="%1$s" class="widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
// Sidebar Widget
// Location: the sidebar
register_sidebar(array(
'name' => 'Sidebar',
'id' => 'main-sidebar',
'description' => __( 'Located at the right side of pages.'),
'before_widget' => '<div id="%1$s" class="widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
// Contact Form Widget
// Location: Contacts page
register_sidebar(array(
'name' => 'Contact Form',
'id' => 'contact_form',
'description' => __( 'Located at the left side of Contacts page.'),
'before_widget' => '<div id="%1$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
// Address Widget
// Location: Contacts page
register_sidebar(array(
'name' => 'Address',
'id' => 'address',
'description' => __( 'Located at the right side of Contacts page.'),
'before_widget' => '<div id="%1$s" class="widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
// Footer Widget Area
// Location: at the top of the footer, above the copyright
register_sidebar(array(
'name' => 'First footer widget area',
'id' => 'first-footer-widget-area',
'description' => __( 'Located at the bottom of pages.'),
'before_widget' => '<div id="%1$s" class="widget-area">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
// Footer Widget Area
// Location: at the top of the footer, above the copyright
register_sidebar(array(
'name' => 'Second footer widget area',
'id' => 'second-footer-widget-area',
'description' => __( 'Located at the bottom of pages.'),
'before_widget' => '<div id="%1$s" class="widget-area">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
// Footer Widget Area
// Location: at the top of the footer, above the copyright
register_sidebar(array(
'name' => 'Third footer widget area',
'id' => 'third-footer-widget-area',
'description' => __( 'Located at the bottom of pages.'),
'before_widget' => '<div id="%1$s" class="widget-area">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
// Footer Widget Area
// Location: at the top of the footer, above the copyright
register_sidebar(array(
'name' => 'Fourth footer widget area',
'id' => 'fourth-footer-widget-area',
'description' => __( 'Located at the bottom of pages.'),
'before_widget' => '<div id="%1$s" class="widget-area">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
}
/** Register sidebars by running elegance_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'elegance_widgets_init' );
?>
боковая панель.php
<aside id="sidebar" class="grid_6 omega">
<?php if ( ! dynamic_sidebar( 'Sidebar' )) : ?>
<div id="sidebar-nav" class="widget menu">
<h3>Navigation</h3>
<?php wp_nav_menu( array('menu' => 'Sidebar Menu' )); ?> <!-- editable within the Wordpress backend -->
</div>
<?php endif; ?>
</aside><!--sidebar-->
любая помощь будет оценена