• I’ve got the following code and need to add a select list to allow users to pick a theme color option. I need the default option to be selected if no option has been previously selected. Otherwise, I need it to reflect the last selected option…

    $themename = "mytheme_wp";
    $shortname = "mt";
    $options = array (
    
    array( "name" => "My Theme Options",
    	"type" => "title"),
    
    array( "type" => "open"),
    
    array( "name" => "Theme Color",
    	"desc" => "choose a theme color from the list",
    	"id" => $shortname."_theme_color",
    	"type" => "select",
    	"std" => "my default option"),
    
    array( "type" => "close")
    
    );
Viewing 1 replies (of 1 total)
  • Thread Starter vestaviascott

    (@vestaviascott)

    And here is my HTML code (just the section for the select)…

    <?php
    break;
    
    case 'select':
    ?>
    <tr>
    <td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
    <td width="80%"><select style="width:240px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"><?php foreach ($value['options'] as $option) { ?><option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?>
    <option id="-blue">Blue</option>
    <option id="-red">Red</option>
    <option id="-gold">Gold</option>
    <option id="fall">Fall</option>
    <option id="-girly">Girly</option>
    <option id="-grey">Grey</option>
    </select></td>
    </tr>
    
    <tr>
    <td><small><?php echo $value['desc']; ?></small></td>
    </tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;">&nbsp;</td></tr><tr><td colspan="2">&nbsp;</td></tr>

Viewing 1 replies (of 1 total)
  • The topic ‘Custom theme control panel with SELECT list, how?’ is closed to new replies.