[英]How to show a Navigation Label instead of a Page Title on a Wordpress custom menu
I am trying to make a custom menu in Wordpress, I've registered it:我正在尝试在 Wordpress 中制作自定义菜单,我已经注册了它:
function theme_features() {
register_nav_menu('header_menu', 'Header Menu');
}
add_action('after_setup_theme', 'theme_features');
and I'm showing it in the front-end:我在前端展示它:
<?php wp_nav_menu(array(
'theme_location' => 'header_menu',
'menu_class' => 'navbar__ul',
));
?>
Then I'm creating the menu in Wordpress admin panel and all is working, the only problem is that when I create an item as such:然后我在 Wordpress 管理面板中创建菜单并且一切正常,唯一的问题是当我这样创建项目时:
on the front-end I am getting the page title and not the navigation label I've set:在前端,我得到的是页面标题,而不是我设置的导航 label:
I've been searching for hours now, if you have any ideas it would be greatly appreciated!!!我已经搜索了几个小时,如果您有任何想法,将不胜感激!!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.