views:

143

answers:

1

Is it possible to have the Parent menu to be redirected to the child menu?

As an example I want this parent item page to redirect to it's children page.

My code for displaying pages as the Main Menu:

<?php wp_list_pages('exclude=3&sort_column=menu_order&title_li=&depth=1'); ?>

here is my code for listing the children menu:

<div id="leftCol">
<?php if($post->post_parent)
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
if ($children) { ?>
<ul>
<?php echo $children; ?>
</ul>
<?php } else { ?>
<?php } ?>
</div>
A: 

it looks like it's already doing that, based off of clicking through your links. However, the easiest way to do a redirect like what you are asking for is by simply using Redirection to generate a 301 redirect. You won't have to mess with your code and you can turn it off and on at any time.

poindexter