Title: Array Checkbox Problem
Last modified: August 19, 2016

---

# Array Checkbox Problem

 *  [brad8985](https://wordpress.org/support/users/brad8985/)
 * (@brad8985)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/array-checkbox-problem/)
 * Ok I’ll try to explain this clearly…
 * In my functions.php file I have some arrays that are used to populate my custom
   theme options menu in the wp-admin area…
 * I have the following code to create a dropdown menu that lists all categories…
 *     ```
       $categories = get_categories('hide_empty=0&orderby=name');
       $wp_cats = array();
       foreach ($categories as $category_list ) {
       $wp_cats[$category_list->cat_ID] = $category_list->name;
       }
       array_unshift($wp_cats, "Choose a category");
   
       $options = array (
   
       // MAIN NAV OPTIONS
   
       array(        "name" => "Main Navigation",
                   "type" => "title"),
   
       array(        "type" => "open"),
   
       array( "name" => "First Navigation Category",
       "desc" => "Choose the first category to appear in the navigation menu at the top of the page",
       "id" => $shortname."_cat01",
       "type" => "select",
       "options" => $wp_cats,
       "std" => "Choose a category"),
   
       array( "name" => "Second Navigation Category",
       ```
   
 * …
 * That works beautifully.
    **What I need now is a checkbox for each category.**
   It is easy enough to do this by just typing the categories out but I need to 
   dynamically populate a checkbox for each category.
 * The above code was pasted and altered so I am not sure how to get the category
   list broken up into separate arrays…
 * Any ideas?

The topic ‘Array Checkbox Problem’ is closed to new replies.

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [arrays](https://wordpress.org/support/topic-tag/arrays/)
 * [function](https://wordpress.org/support/topic-tag/function/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [brad8985](https://wordpress.org/support/users/brad8985/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/array-checkbox-problem/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
