浏览器选项卡中的Wordpress导航标签

时间:2012-06-02 21:00:02

标签: php wordpress navigation page-title

我正在尝试修改我的header.php以调用页面的 导航标签 ,而不是 页面标题 即可。这是现有的代码......

<title><?php wp_title( '' ); ?></title>

调用或回显菜单项的 导航标签 的代码是什么?

enter image description here

感谢。

1 个答案:

答案 0 :(得分:0)

您需要访问wp_nav_menu_objects,首先渲染菜单以提取标签,以便在页面title上使用它。

您可以在此链接上看到一个有效解释的工作解决方案:

How to get current-menu-item title as variable?

first render the menu and then display it later