Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个“注册”菜单列表,当用户登录时,“注册”菜单消失了。
我怎样才能做到这一点?
我使用 Appearance -> Menus 创建了菜单
您可以在主题中使用以下代码来实现此目的:
<?php if ( is_user_logged_in() ) { echo 'Welcome, registered user!'; } else { echo '<a class="register-menu" href="#">Register</a>'; //make sure to add the correct link there. } ?>
您可以使用该类自定义此链接样式.register-menu
.register-menu