[wordpress]Page.php ---> problem Showing Current Page in select!?

  • Thread starter Thread starter motylanogha
  • Start date Start date
M

motylanogha

Guest
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>
<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 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
 
Back
Top