Wordpress Navigation Label in Browser tab
-
12-06-2021 - |
문제
I am trying to edit my header.php to call the navigation label of a page as opposed to the page title. Here is the existing code...
<title><?php wp_title( '' ); ?></title>
What is the code for calling or echoing the navigation label of a menu item?
Thanks.
해결책
What you need is to access the wp_nav_menu_objects
, by first rendering the menu to extract the label in order to use it on the page title
.
You can see a working solution well explained on this links:
제휴하지 않습니다 StackOverflow