list parent & children with custom field data too
-
I am trying to list one specific parent page and all the children under it. The output is simply the permalink and the custom field.
I have got all the children of the parent, but I don’t know how to have that parent also output.
Your help would be greatly appreciated.
This is what I have so far:
<?php $pageChildren = get_pages('child_of=1844'); if ( $pageChildren ) { foreach ( $pageChildren as $pageChild ) { $meta = get_post_meta($pageChild->ID, 'submenu-extratext', true); echo '<li><a href="' . get_permalink($pageChild->ID) . '">'. $meta .'</a></li> '; } } ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘list parent & children with custom field data too’ is closed to new replies.