Showing data from child pages in page parent
-
Hi guys,
Currently using flutter, but that’s not the problem here.
Trying to get some info from the children of a page parent to appear in the page parent’s content. Using this code atm but it’s not working :<? elseif(is_page('people')) // if page is People :?> <?php $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc'); $count = 0; foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; if($count >= 2) break; $count++; $content = apply_filters('the_content', $content); ?> <h2><a href=\"<?php echo get_page_link($page->ID) ?>\"><?php echo $page->post_title ?></a></h2> <div class=\"entry\"><?php echo $content ?></div> <?php } ?> <? else: ?>
I have other conditionals around it thus the elseifs and else. Help?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Showing data from child pages in page parent’ is closed to new replies.