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: