Advertisement
Guest User

get array of custom fields in wordpress

a guest
Jul 10th, 2013
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.21 KB | None | 0 0
  1. <?php
  2.   $mykey_values = get_post_custom_values('years');
  3.   echo '<select name="year">';
  4.   foreach ( $mykey_values as $year ) {
  5.     echo '<option value="'.$year.'">'.$year.'</option>';
  6.   }
  7.   echo '</select>';
  8. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement