wp_list_pages and get_post_metadata
-
Hello all,
Been hunting for an answer here and I’m not quite finding.
I am using wp_list_pages on pages to list children pages, as such:
<?php wp_list_pages("title_li=&child_of=".$post->ID."&sort_column=menu_order");?>
This works great for me. However, (and there’s always a but, isn’t there?), we would like to display a description of each page in that list.
I’m thinking, it’s relatively straightforward, add a page description in the Custom Fields area, and then use get_post_meta to retrieve it if it exists. I can also do this.
What I can’t seem to figure out is how to insert that meta data in the list generated by wp_list_pages. so instead of
<li>Page title</li>
we would have<li>Page title<br />Page description</li>
.I’d rather not just hack the function itself (hell on future upgrades).
Any assistance would be greatly appreciated on this.
Thanks
- The topic ‘wp_list_pages and get_post_metadata’ is closed to new replies.