• 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.