Posted By

selfmadepsyche on 02/17/09


Tagged

wordpress


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

rezzz


Display Categories Normally or in Drop-Down Box


 / Published in: PHP
 

  1. <h2>Categories</h2>
  2. <ul>
  3. <?php wp_list_cats('sort_column=name'); ?>
  4. </ul>
  5.  
  6.  
  7.  
  8. <form action="<?php bloginfo('url'); ?>/" method="get">
  9. <?php
  10. $select = wp_dropdown_categories('show_option_none=Select category&show_count=1&orderby=name&echo=0');
  11. $select = preg_replace("#<select([^>]*)>#”, “<select$1 onchange=’return this.form.submit()’>”, $select); echo $select; ?>
  12. <noscript><input type=”submit” value=”View” /></noscript>
  13. </form>

Report this snippet  

You need to login to post a comment.