【问题标题】:How to fix Menu not centered in wordpress如何修复不在wordpress中居中的菜单
【发布时间】:2019-09-10 05:24:51
【问题描述】:
  • 请帮助我无法使我的菜单在我的网站中居中是菜单始终正确
  • 我使用新页面进行主页设置和那个错误
  • 是我使用主页默认设置的中心,但该页面我无法编辑 网站 : http://k17tcth11.beget.tech 对不起我的英语

这是为 Wordpress 准备的

<nav class="awemenu-nav awemenu-has-logo <?php print $is_transparent_mode ? 'awe-header--transparent' : ''; ?>" data-sticky="<?php echo esc_attr( (bool) mojado_option( 'mojado_header_nav_sticky' ) ); ?>">
            <div class="container">

                <div class="awemenu-container">
                    <div class="awemenu-language-search awe-fr">
                        <?php get_template_part( 'template-parts/header-search' ); ?>
                        <?php get_template_part( 'template-parts/header-language' ); ?>
                    </div>

                    <?php if ( $is_transparent_mode ) : ?>
                        <?php print mojado_site_logo( 'home_logo', true, '<div class="home-logo">', '</div>' ); // WPCS: XSS OK. ?>
                    <?php endif; ?>

                    <?php
                    /**
                     * Navigation Main Menu.
                     */
                    wp_nav_menu( array(
                        'container'      => '',
                        'menu_id'        => 'primary-menu',
                        'menu_class'     => 'main-navigation awemenu',
                        'theme_location' => 'primary',
                        'walker'         => new Mojado_Walker_Menu,
                        'fallback_cb'    => array( 'Mojado_Menu_Support', 'fallback' ),
                    ) );
                    ?>
                </div><!-- .awemenu-container -->

            </div><!-- .container -->
        </nav><!-- .awemenu-nav -->

【问题讨论】:

    标签: html css wordpress menu center


    【解决方案1】:

    在 header.scss 第 8 行替换为我的 CSS。这将解决您的问题。

    .awe-header--transparent.awemenu-standard:not(.awemenu-sticky) {
        top: 0;
        width: 100% !important;
        position: absolute;
        background-color: transparent;
        left: 0px;
    }
    

    【讨论】:

      猜你喜欢
      • 2017-11-30
      • 2013-01-10
      • 2018-07-21
      • 2014-06-19
      • 2013-11-06
      • 2018-10-19
      • 2014-04-14
      • 2011-11-20
      • 1970-01-01
      相关资源
      最近更新 更多