WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I put this code into my functions.php https://gist.github.com/corvannoorloos/4703066 and it work nice.

Now I want to display value from Sample Select Options filed in some front-end templates.

How can I do that? I tried get_option

<?php echo get_option( 'sample_select_options', true); ?>

but it return number 1 no matter what is selected.

share|improve this question
At first glance, you need to make sure you call the correct option. Looking at the Gist, there is a _s_ prefix to the option. Since _s_simple_select_options is an array, you might need a foreach loop to deal with multiple values. – JMB Jan 7 '14 at 13:37
Hi @Strap1. Thank you for the advice. I am not related to php so I am trapped here. I found this post aquoid.com/news/tutorials/wordpress-theme-options/… There is a code snippet to retrive the options. Is that near to what I need? – pendjer Jan 15 '14 at 18:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.