Hello. I am still learning Wordpress but have been picking it up very well as I go along. Tonight I am stuck though and need help :)
I found the code on these forums and it is working as I was hoping (pulling the content from all the child pages of the parent and displaying on one page). I need to know how to sort the results though, where would I add that into this code?
<?php
$current_page = $post->ID;
$querystr = "
SELECT * from $wpdb->posts
WHERE post_type = 'page'
AND post_parent = $current_page
";
$child_pages = $wpdb->get_results($querystr, OBJECT);
if ($child_pages):
foreach($child_pages as $post) :
setup_postdata($post); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php endforeach; ?>
<?php else : ?>
// Do stuff when no child page available
<?php endif; ?>
Thank You