如何将复杂菜单更改为简单的文本菜单

时间:2011-12-08 04:29:27

标签: css wordpress menu wordpress-theming

在我目前的wordpress主题中,存在以下菜单:

enter image description here

我希望它只是一个简单的基于文本的菜单:

enter image description here

这是菜单的style.css:

/* =Menu
-------------------------------------------------------------- */

#access {
    background: #ffffff; /* Show a solid color for older browsers */
}
#access ul {
    font-size: 13px;
    list-style: none;
    margin: 0 0 0 -0.8125em;
    padding-left: 0;
}
#access li {
    float: left;
    position: relative;
}
#access a {

}
#access ul ul {

}
#access ul ul ul {

}
#access ul ul a {

}
#access a:focus {
}
#access li:hover > a,
#access a:focus {
}   
#access ul li:hover > ul {
}
#access .current_page_item > a,
#access .current_page_ancestor > a {
    font-weight: bold;
}

这是当前菜单的php代码。我不知道如何在不破坏它的情况下拆卸它。在此先感谢您的帮助。

<nav id="access" role="navigation">
                <h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
                <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
                <div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div>
                <div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div>
                <?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
                <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
            </nav><!-- #access -->

1 个答案:

答案 0 :(得分:0)

您可以通过修改传递函数调用的数组来删除导航菜单中包含的HTML。阅读更多:wp_nav_menu#removing the navigation container