Hi
I want to display current page [selected=selected] and parent page [selected=selected] in select form.
So I've put in page.php for current parent page:
<form>
<select>
<?php
$include_page_ids = array('7','8','11','12','13','14','15','16','17','18','19','21','23','24','25'); //also the order of appearance
for ($i = 0;$i < count($include_page_ids);$i++) {
$args = array('title_li'=>'','include' => $include_page_ids[$i],'link_before'=>'<option>','link_after'=>'</option>');
wp_list_pages( $args );
}
?>
</select>
</form>
and for current page:
<form>
<?
if(wp_list_pages('child_of='.$post->ID.'&echo=0&exclude=2')) {
echo "<p>";
wp_list_pages('title_li=&child_of='.$post->ID.'&exclude=2'.'link_before= <option selected=selected>'.'link_after=</option>');
echo "</p>";
}
elseif(get_the_title($post->post_parent) != the_title(' ' , ' ',false)) {
echo "<select>";
wp_list_pages('child_of='.$post->post_parent.'&title_li=&exclude=2'.'link_before=> <option>'.'link_after=></option>');
echo "</select>";
} ?>
</form>
and the parent page seems to almost work [doesn't display selected=selected] while current page does not at all...
Changing the select filed should change the url as well...
Do you have an idea how to work it out?
Thanks!
Marius