symdesign
7/22/2015 - 12:29 PM

Page Redirect

<?php 
/*
Template Name: Weiterleitung

 *
 * This template redirects to the first child
 *

*/

$pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order");
if ($pagekids) {
	$firstchild = $pagekids[0];
	wp_redirect(get_permalink($firstchild->ID));
}