I am using wp_list_pages to create a submenu on a page and child page.
All working fine
My menu looks like
Parent, page title is Hello
Child,
Child,
Child,
etc
I am trying to find a way to dynamically change the Page title on output.
In my example above, I would like my Parent page to display GoodBye instead of Hello.
You might wander why I don’t just rename my page to Goodbye.
It is because the Page title , in my design, is displayed in 3 different format
– menu Header Hello displays Welcome (can change this via WP menu
– Page title display the correct title, ie Hello
I need my left menu to display Goodbye….
hope this makes sense for somebody
thx
Use a custom field on your page…let’s call it
sidebar_title
.Then, you’ll need to convert your
wp_list_pages
code into a custom WordPress loop (there might be a way to useget_pages
to do the same if you prefer that.Here’s some sidebar code to list the current page and it’s child pages, replacing
the_title();
with yoursidebar_title
if it exists. It’s pretty ugly…the main point is to show you how to access custom fields.