how to write get_meta_post in the style of wp_list_pages
-
I’d like to replicate
wp_list_pages
exactly but usingget_meta_post
. Why?I have a huge list of hierarchical pages (parent/child). I’d like to list these pages out as
wp_list_pages
lists them.This is the source code I’m hoping to replicate:
<ul class="items"> <li class="page_item page-item-123 parent"><a href="/wordpress/region/city/" title="city"><img src="city-name.jpg" alt="City" /></a> <ul class='children'> <li class="page_item page-item-124 parent"><a href="/wordpress/region/city/suburb/" title="Suburb">Suburb</a> <ul class='children'> <li class="page_item page-item-125"><a href="/wordpress/region/city/suburb/complex/" title="Complex">Complex</a></li> </ul> </li> </ul> </li> </ul>
where city-name.jpg is defined in the custom fields section. All pages should show up like normal but the pages with custom fields should transfer the title name out for an image.
How do I do this? I am starting to think that it’s not possible with wp_list_pages but I’m not strong enough with PHP to do this myself.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘how to write get_meta_post in the style of wp_list_pages’ is closed to new replies.