Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi, try this…

    <div id=”container”>

    <?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”);
    if ($pagekids) {
    $firstchild = $pagekids[0];
    wp_redirect(get_permalink($firstchild->ID));
    }

    ?>

    <div class=”post”>

    <h2><?php the_title();?></h2>

    <div class=”entry”>

    <?php the_content(); ?>

    <?php link_pages(‘<p>Pages: ‘, ‘</p>’, ‘number’); ?>

    <?php edit_post_link(‘Edit’,'<p>’,'</p>’); ?>

    </div>

    </div>

    <?php endwhile;?>

    <?php else: ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>

    <h2><?php_e(‘Not Found’); ?></h2>
    </div>

    <?php endif;?>
    </div>

    <?php include (TEMPLATEPATH . ‘/sidebar2.php’); ?>

    </div>

    hope it will solve you problem.

Viewing 1 replies (of 1 total)