Created
October 25, 2013 21:27
-
-
Save rodica-andronache/7162111 to your computer and use it in GitHub Desktop.
WORDPRESS - Make a select with category list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form action="<?php bloginfo('url'); ?>/" method="get"> | |
| <?php | |
| $select = wp_dropdown_categories('show_option_none=Select Category&show_count=1&orderby=name&echo=0&selected=6'); | |
| $select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select); | |
| echo $select; | |
| ?> | |
| <noscript><input type="submit" value="View" /></noscript> | |
| </form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment