category drop down menu issue
-
I want to change the category list in the sidebar to a drop down menu. I used this code:
<li id="categories"><h2><?php _e('Posts by Category'); ?></h2> <?php wp_dropdown_categories('show_option_none=Select category'); ?> <script type="text/javascript"><!-- var dropdown = document.getElementById("cat"); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = "<?php echo get_option('home'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value; } } dropdown.onchange = onCatChange; --></script> </li>
This is coming up not valid in XHTML. Any suggestions on a better method?
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘category drop down menu issue’ is closed to new replies.