WordPress.org

Ready to get started?Download WordPress

Forums

wp_dropdown_pages select current page (2 posts)

  1. eXtreaL
    Member
    Posted 2 years ago #

    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(); ?>">
    		</form>

    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!

  2. eXtreaL
    Member
    Posted 2 years ago #

    I still haven't solved this problem. I've tried using WP's current page function, but this didn't work out.

Topic Closed

This topic has been closed to new replies.

About this Topic