开发者

Functions php, make drop down list work

开发者 https://www.devze.com 2023-01-12 02:45 出处:网络
In functions php, this works like a charm: <textarea name=\"menu1anchor\" id=\"menu1anchor\" cols=\"40\" rows=\"1\"><?php echo get_option(\'menu1anchor\'); ?></textarea>

In functions php, this works like a charm:

<textarea name="menu1anchor" id="menu1anchor" cols="40" rows="1"><?php echo get_option('menu1anchor'); ?></textarea>

How can i make this drop down list work? I want to be able to input my values and select a desired one later on.

开发者_开发问答Right now, it does not matter which value I select, after i press "save changes" it does not send my value thru the form to wordpress options.

<select name="menu1" id="menu1">
     <option value="1">Microsoft</option>
     <option value="2">Google</option>
     <option value="3">Apple</option>
     </select>

Thank u!


<select name="menu1" id="menu1">
     <option value="1"<?php selected(get_option('menu1'),1); ?>>Microsoft</option>
     <option value="2"<?php selected(get_option('menu1'),2); ?>>Google</option>
     <option value="3"<?php selected(get_option('menu1'),3); ?>>Apple</option>
     </select>

Try that instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消