I am currently creating some theme options in wordpress & I am trying to create a select box so the user can select a skin to use for the theme. I am new to wordpress theme options so I don't know a lot about them.
I am in need of some help with the php so that when the user selects one of the options it updates that option with selected="selected" & saves it and then the value of that option is sent to the header.php file so i can use it from there.
HTML Select I am using
<select>
<option value="" selected="selected">Select a skin</option>
<option value="light.css">Light Skin</option>
<option value="dark.css">Dark Skin<开发者_如何转开发;/option>
</select>
Thanks for any help!
Could not create a query to add the selected="selected"
for example:
<select>
<option value="">Select a skin</option>
<option value="light.css" <?php if($theme == $themename):?>selected="selected" <?php endif; ?>>Light Skin</option>
<option value="dark.css">Dark Skin</option>
</select>
You would add this to all <option>
elements
精彩评论