微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在navwalker中插入<div>

如何解决在navwalker中插入<div>

所以我遇到了一些问题,我想不出如何解决方法,我最近开始使用wordpress navwalkers,但是我只停留在特定的部分上,所以我无法弄清楚如何解决它。

所以我在wordpress主题内使用布尔玛框架。

这是我要实现的目标(如果有任何疑问,请给我批评,我仍在学习中)-我只是想不出如何在第一个{{ 1}}:

enter image description here

这是我的$depth标头:

wp_nav_menu

以下是navwalker代码

<div class="container">
            <div class="navbar-menu is-active">
                    <div class="navbar-start" id="main-navigation">
                        <?PHP
                        wp_nav_menu( [
                            'theme_location' => 'primary','depth' => 3,'container' => true,'items_wrap' => '%3$s',// Removes the <ul>
                            'walker' => new Nav_walker(),]);
                        ?>
                    </div>

                <div class="navbar-end">
                    <div class="navbar-item">
                        <figure class="image is-48x48">
                            <img class="is-rounded" src="<?PHP if (is_user_logged_in()) {
                                $current_user = wp_get_current_user();
                                if (($current_user instanceof WP_User)) {
                                    echo get_avatar_url($current_user->ID,32);
                                }
                            } ?>" alt="profile picture">
                        </figure>
                        <div class="pl-2"><?= $user->get_user_login(); ?></div>
                    </div>
                </div>
            </div>
        </div>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。