Title: [Plugin: WP Easy Post Types] Select Lists are displaying empty values?
Last modified: August 19, 2016

---

# [Plugin: WP Easy Post Types] Select Lists are displaying empty values?

 *  [eitai2001](https://wordpress.org/support/users/eitai2001/)
 * (@eitai2001)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-easy-post-types-select-lists-are-displaying-empty-values/)
 * Hi Guys.
 * I created a custom field with a select list and I entered values. When I go to
   the custom post type and add new content, the dropdown list shows blank values,
   but if I look at the source code, the values are defined in there … they’re just
   not visible.
 * I’m running the standard wordpress admin theme, so I have no idea what the issue
   is?
 * Just to give you an idea of the code being generated:
 *     ```
       <div class="field-phone_os field-phone_os">
                   <span class="label">Operating System</span>
       <select name="phone_os">
               <option  value="Android 1.5 Cupcake"></option>
               <option  value="Android 1.6 Donut"></option>
               <option  value="Android 2.1 Eclair"></option>
               <option  value="Android 2.2 Froyo"></option>
               <option  value="Android 3.0 Gingerbread"></option>
           </select>
   
               </div>
       ```
   
 * Regards
 * Itai
 * [http://wordpress.org/extend/plugins/easy-post-types/](http://wordpress.org/extend/plugins/easy-post-types/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [mchampa](https://wordpress.org/support/users/mchampa/)
 * (@mchampa)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-easy-post-types-select-lists-are-displaying-empty-values/#post-1675643)
 * Hi Itai,
    I have the same problem. I was able to change one line of code in the
   plug-in, and the select drop down now displays values and text in the select 
   control. This seems like the wrong thing to do, but works in the interim until
   someone can explain how this should properly work.
 * In the file /classes/custom-select/theme-select-input.php, line 7,
 * `<option <?php print $option['selected']; ?> value="<?php print $option['key'];?
   >"><?php print $option['value']; ?></option>`
 * I changed the second value to key
    `<option <?php print $option['selected']; ?
   > value="<?php print $option['key']; ?>"><?php print $option['key']; ?></option
   >`
 *  [itst](https://wordpress.org/support/users/itst/)
 * (@itst)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-easy-post-types-select-lists-are-displaying-empty-values/#post-1675666)
 * You need to input the list in a [key]|[value] format like this:
 * 1|Monday
    2|Tuesday 3|Wednesday 4|Thursday 5|Friday 6|Saturday 7|Sunday
 * This would render as
 *     ```
       <option value="1">Monday</option>
       <option value="2">Tuesday</option>
       ... and so on.
       ```
   
 * Hope this helps.
 * BTW, the logic can be found in easy-post-types/classes/custom-select/custom-select.
   php in the function prepareArray().
 * If you want to use PHP the generate the list, your code needs to return an array
   like this:
 *     ```
       return array(
          array(1, 'Monday'),
          array(2, 'Tuesday'),
          ... and so on.
       );
       ```
   
 *  [mchampa](https://wordpress.org/support/users/mchampa/)
 * (@mchampa)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-easy-post-types-select-lists-are-displaying-empty-values/#post-1675667)
 * Perfect…thanks Itst for clarifying. Very much appreciated.
 *  Thread Starter [eitai2001](https://wordpress.org/support/users/eitai2001/)
 * (@eitai2001)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-easy-post-types-select-lists-are-displaying-empty-values/#post-1675677)
 * Thanks Itst 🙂
 *  [secci](https://wordpress.org/support/users/secci/)
 * (@secci)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-easy-post-types-select-lists-are-displaying-empty-values/#post-1675722)
 * cheers itst! been wondering that for months!
 *  [a2d](https://wordpress.org/support/users/a2d/)
 * (@a2d)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-easy-post-types-select-lists-are-displaying-empty-values/#post-1675723)
 * Seems to be a few ways to display the selected value in a template.
    With a custom
   select field called weekday, with the label “Day” and content: 1|Monday 2|Tuesday
   3|Wednesday 4|Thursday 5|Friday 6|Saturday 7|Sunday
 * The “snippit” way:
    `<?php the_ept_field('weekday'); ?>` Displays e.g. **Day 
   Monday**
 * or:
    `<?php echo get_ept_field('weekday'); ?>` Displays e.g. **Day Monday**
 * To just get the value so you can use your own label then you’d think you could
   use:
    `<?php echo get_ept_field('weekday',array('raw' => 'true')); ?>` or alternatively:`
   <?php echo get_post_meta($post->ID,'weekday',true) ?>` But both these display**
   1** (the _value_ of the select option rather than the _text_ of the option)
 * How can you just get the text? I can remove the label e.g.
    `<?php echo preg_replace('/
   Day/','',get_ept_field('weekday'),1); ?>`
 * But there must be an easier way?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: WP Easy Post Types] Select Lists are displaying empty values?’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/easy-post-types.svg)
 * [WP Easy Post Types](https://wordpress.org/plugins/easy-post-types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-post-types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-post-types/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-post-types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-post-types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-post-types/reviews/)

 * 6 replies
 * 5 participants
 * Last reply from: [a2d](https://wordpress.org/support/users/a2d/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-easy-post-types-select-lists-are-displaying-empty-values/#post-1675723)
 * Status: not resolved