• Hi guys

    I have this little script that I am using to populate a list in my theme-options panel:

     $myterms = get_terms('portfoliocats', array('hide_empty'=>false));
    $getTerms = array();
    foreach ($myterms as $term_list ) {
    	$getTerms [$term_list->term_id] = $term_list->term_name
    	}
    }

    This works fine when added to a page, but when trying to use this in the theme-options panel, it returns nothing. Any thoughts?

    The same code works fine for getting categories:

    $categories = get_categories(array('hide_empty'=>false));
    $getcat = array();
    foreach ($categories as $category_list ) {
           $getcat[$category_list->cat_ID] = $category_list->cat_name;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_terms not working in theme options panel’ is closed to new replies.