WordPress.org

Support

Support » Themes and Templates » wp_dropdown_pages – styling the dropdown menu with css

wp_dropdown_pages – styling the dropdown menu with css

  • I am using the wp_dropdown_pages tag to generate a list of pages that show in a dropdown menu.

    I can’t work out how to style this form menu – where does the code come from? I have other form fields/dropdowns styled throughout my site but can’t work out where to add the class for this one. Code is…

    <form action="<?php bloginfo('url'); ?>/" method="get" >
    <?php
    	$select = wp_dropdown_pages('show_option_none=Select An Artist&show_count=1&orderby=name&echo=0&child_of=4');
    	$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
    	echo $select;
    ?>
    	<noscript><input type="submit" value="View" /></noscript>
    	</form>

    Any ideas?

  • The topic ‘wp_dropdown_pages – styling the dropdown menu with css’ is closed to new replies.
Skip to toolbar