cherry-webprojects
Member
Posted 1 year ago #
Hi,
I would like to achieve the following: I use a menu for the main horizontal navigation. Pages should not only get a title but above the title there should be listed the menu label for this page as well. Do not think of a breadcrumb! It is really what I described: above the title I want to show the menu label for this page - just imagine a menu label "Products" and a title for this page like "Easy solutions for you".
Is there a way to get this menu label from a specific menu into the page.php?
Best,
Tobias
Something like this perhaps? Replace ID with the page ID and CUSTOM TITLE with your custom title.
<?php if (is_page('ID')) { ?>
CUSTOM TITLE - <?php the_title(); ?>
<?php } ?>
So if your Products page has an ID of 12, you'd do the follow:
<?php if (is_page('12')) { ?>
Products - <?php the_title(); ?>
<?php } ?>
Probably a cleaner way of doing it, but this should point you in the right direction.
cherry-webprojects
Member
Posted 1 year ago #
Thank you for your prompt response. Unfortunately I would need a more general solution. So if someone writes a new page the menu label should be included automatically... in the way you described I would have to work on the theme file every time a new page is generated.