Support » Fixing WordPress » wp_dropdown_pages select current page

  • Hi guys,

    I’m running into a bit of trouble using the wp_dropdown_pages function. I’m creating a dropdown list to link to certain pages using the following lines:

    <form name="form1" action="" method="get">
    			<?php $select = wp_dropdown_pages('show_option_selected=&depth=100&sort_column=menu_order&echo=0');
    			$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
    			echo $select;
    			<noscript><input type="submit" name="submit" value="" /></noscript>
    			<input type="hidden" name="lang" value="<?php echo qtrans_getLanguage(); ?>">

    At the moment this code allows me to navigate to the page I select. What I’d like now is that it selects the current page in it’s value. I know there must be an option here to make WP do that.

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • I still haven’t solved this problem. I’ve tried using WP’s current page function, but this didn’t work out.

Viewing 1 replies (of 1 total)
  • The topic ‘wp_dropdown_pages select current page’ is closed to new replies.