• Resolved nicdvs

    (@nicdvs)


    Hi everyone,

    I created an option page for a theme I am making. I am trying to add a field for each custom taxonomies found in the custom post portfolio. Since I do not know what will be the available taxonomy, I need this to be dynamic.

    I am not even sure if this is possible… here is the error I get for now:

    “syntax error, unexpected T_FOREACH, expecting ‘)”

    And here is the code that throw that error:

    $taxonomy = 'skills';
    $terms = get_terms($taxonomy);
    
    $options = array(
    	array(	'name' => $themename.' Options',
    			'type' => 'title'),

    foreach($terms as $term){
    	array(	'name' => 'Logo URL',
    			'desc' => 'Enter the link to your logo image',
    			'id' => $shortname.'_logo',
    			'type' => 'text',
    			'std' => get_bloginfo('template_directory') .'/images/logo_CHANGEME.png'),
    	}

    Any help is appreciated.

    Thanks,

    Nicolas

  • The topic ‘Add options to array with for each loop’ is closed to new replies.