Using WordPress can be tricky in a situation where you need to create menu items that are not directly linked to pages. By default and sadly, WordPress doesn’t allow creation of “menus” (cough…like in Drupal) because menu items are only generated through the creation of pages. Plugins like NAVT and Page Links To provide workarounds to this issue. But there’s one fairly uncomplicated instance in which you may just want a page menu item to simply redirect to its first child page – ie, if you have two levels of pages, whereby the first level really only provides a main navigation to help you drill deeper into the subpages.
Thanks to a response from jcdesign in the wordpress forums, there’s a tiny php script you can add to a custom page template (eg, page-firstchild.php) to redirect this top level page/link to its first child page.
<?php
/*
Template Name: Go to first child
*/
$pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order");
if ($pagekids) {
$firstchild = $pagekids[0];
wp_redirect(get_permalink($firstchild->ID));
} else {
// Do whatever templating you want as a fall-back.
}
?>