Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

olddocks on "Issues with select box in options page?"

$
0
0

i am trying to use selected() function in my select box, inside my wordpress theme options page. The problem is with numbers it works but it is not working comparing strings. Note that below if nothing is selected, automatically default is selected in the select box

Theme Style <select name="corpocrat-options[theme-style]">
  <option value="" <?php selected($corpocrat_options['theme_style'],""); ?>>Default</option>
  <option value="black" <?php selected($corpocrat_options['theme_style'],"black"); ?>>Black</option>
  <option value="blue" <?php selected($corpocrat_options['theme_style'],"blue"); ?>>Blue</option>
  <option value="grey" <?php selected($corpocrat_options['theme_style'],"grey"); ?>>Grey</option>
  <option value="grunge" <?php selected($corpocrat_options['theme_style'],"grunge");  ?>>Grunge</option>
</select>

Viewing all articles
Browse latest Browse all 8245

Trending Articles