Second Loop in WordPress

Filed under: Web Development,Wordpress — Tags: , , — Chris @ 8:48 pm

Twice today I wanted, tried and failed to create a loop to list all the children pages of the current page in wordpress. Adn yes I know I could use “wp_page_menu” or “wp_list_pages” but the problem is I wanted to include custom fields in the output.

Look at my works page. I wanted each website to be a child page of work and display the content, or a custom field, as an excerpt. And to my knowledge I can’t do that with any of the page list functions. Anyone know how to do this? Making the work pages as posts isn’t really an option.

For my works page I just listed them statically. For the other attempt I had to create a MySQL query against the posts table and manually create the list. Not ideal.

So if anyone sees this and might know a solution, please drop me a line!