Wordpress: A categories dropdown menu


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <form action="<?php bloginfo('url'); ?>/" method="get" class="dropcats" >
  2. <?php
  3. $select = wp_dropdown_categories('show_option_none=Επιλέξτε Κατηγορία:&show_count=0&heirarchial=1&orderby=ID&echo=0');
  4. $select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
  5. echo $select;
  6. ?>
  7. <noscript><input type="submit" value="View" /></noscript>
  8. </form>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.