/ Published in: PHP

This snippet is originally from Tom Carden. All due credit goes to him.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?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)); } } ?>
URL: http://www.tom-carden.co.uk/2008/02/08/artnano-wordpress/#more-711
Comments
