Can't Select '0' As a Numeric Option
-
I’m using a theme from Templatic.com called Real Estate 2. Overall the theme is great but I’m running a problem that the developer doesn’t have a solution for.
There is a custom field that is built-in which allows the specific post_type (in this case a property listing) to select a bedroom count. However, 0 (Zero, as in Studio/bachelor pad) is not an included option. The developer said the reason the number ZERO couldn’t be included is because it’s not a numerical value. Below is the area in the custom_function.php file that the developer said he tried to make edits to but couldn’t get it to work.
Can anyone see based on the code below where I can make a change so I can add 0 as an option?
Thanks for any help.
<?php } function get_max_number_bedrooms() { $generalinfo = get_option('mysite_general_settings'); if($generalinfo['max_bedrooms']) { return $generalinfo['max_bedrooms']; }else { return 10; } } function get_bedroom_dl($proprty_bedroom) { $i=1; $max_bedrooms = get_option('ptthemes_bedrooms'); for($i=1;$i<=$max_bedrooms;$i++) { $addval = ''; echo '<option '; if($i==$proprty_bedroom) { echo 'selected="selected"'; } if($i==$max_bedrooms) { $addval = "+"; } echo ' value="'.$i.$addval.'">'.$i.$addval.'</option>'; } }
The topic ‘Can't Select '0' As a Numeric Option’ is closed to new replies.