I'm using the Simple Fields plugin for a custom WordPress theme. I have the code below to create a dropdown for a size selector, pulling from the options that the admin has created:
<select>
<?php if($sizetotal > 0 && $sizes[0] != 0){?>
<?php for($x = 0; $x < $sizetotal; $x++){?>
<option value="<?php echo $sizes[$x]; ?>"><?php echo $sizes[$x]; ?></option>
<?php }?>
<?php }?>
</select>
This is working fine, but I'm wondering how I can echo $sizes[$x]; again, outside this loop so that it reflects what the user chose (in a form, for example).
Very new to PHP, so any help would be much appreciated.
Thanks