php - How can I create a checked listbox of Wordpress categories? -


the first thing tried following

<input type="checkbox" id="check1" />     <label for="check1">          <ul id="selectable0">               <li><?php wp_list_cats(); ?></li>          </ul> </label> 

this creates single checkbox. want have listbox checkbox beside each item.

<?php $categories = get_categories(); foreach ($categories $category) { ?> <input type="checkbox" name="check" value="<?php echo $category->cat_id; ?>"><?php echo $category->cat_name;?><br> <?php } ?> 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -