How can I hook the wp_list_pages function so that it reads a value of a custom field and displays it instead of displaying the page title?
Leave a Reply
You must be logged in to post a comment.
How can I hook the wp_list_pages function so that it reads a value of a custom field and displays it instead of displaying the page title?
You must be logged in to post a comment.
A quick Google Search came up with this
Source
Try the following:
A Walker Class extension would be necessary in this case:
Then, when you use your wp_list_pages function, you would call the class:
Documentation on this subject is a bit scarce so let me know if you need more help.
You are able to pass in your own custom walker as one of the args, use this to pass in a walker which extends
Walker_Page
and uses your own custom post title.