Thanks, govpatel. Maybe you can help answer this similar question. I’m redirecting the top level page to the first child page with this code.
<?php
/*
Template Name: Redirect To First Child
*/
if (have_posts()) {
while (have_posts()) {
the_post();
$pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order");
$firstchild = $pagekids[0];
wp_redirect(get_permalink($firstchild->ID));
}
}
?>
This works if I use the Page Attributes Order numbering, but it does not work if I rely on the Menu Panel order. For example, in the Menu Panel I have my first child page directly under the parent page, yet, it goes to the 3rd or 4th child page instead. Thoughts?