не могу изменить элементы боковой панели wordpress

У меня есть сайт 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-->

любая помощь будет оценена


person HurkNburkS    schedule 28.10.2012    source источник


Ответы (1)


<div id="sidebar-nav" class="widget menu">
            <h3>Navigation</h3>
            <?php wp_nav_menu( array('menu' => 'Catalogue' )); ?> <!-- editable within the Wordpress backend -->
</div>

Просто измените значение в wp_nav_menu(array('menu' => 'Каталог')); это вызовет ваше меню под названием «Каталог», в теме указано, что вы можете изменить выбранное меню из бэкэнда

person Halaster    schedule 28.10.2012
comment
Кроме того, убедитесь, что в разделе внешний вид-›виджеты-›боковая панель пусто, и в этой области нет виджетов, иначе ваше меню не будет отображаться!.. - person Marty; 28.10.2012
comment
хорошо, это сработало, чтобы записи изменились !! что меня взволновало, потому что мне потребовались годы, чтобы добраться до этого места ... но это изменило стиль меню ... Я добавлю изображения до и после к моему вопросу, чтобы у вас было лучшее представление. - person HurkNburkS; 28.10.2012
comment
на самом деле я не могу вернуть его сейчас... :( буду продолжать попытки, дам вам знать, как я иду... но знаете ли вы, почему я теряю свой стиль, когда использую этот код. - person HurkNburkS; 28.10.2012
comment
Честно говоря, я не вижу причин, по которым он потерял бы свой стиль, может быть, вы можете вернуть его в прежнее состояние, проверить элементы и посмотреть, что изменилось, а что нет? Возможно, в другом меню были назначены некоторые классы. - person Halaster; 28.10.2012