I am using the WPAlchemy MetaBox Class to create additional metaboxs on my site. One has a section with a group of radio boxes. I've coded it as follows:
<?php $mb->the_field('docposs'); ?>
<input type="radio" name="<?php $mb->the_name(); ?>" value="yes"<?php $mb->the_radio_state('yes')?' checked="checked"':''; ?>/>Yes
<input type="radio" name="<?php $mb->the_name(); ?>" value="no"<?php $mb->the_radio_state('no')?' checked="checked"':''; ?>/>No
<input type="radio" name="<?php $mb->the_name(); ?>" value="unknown"<?php $mb->the_radio_state('unknown')?' checked="checked"':''; ?> />Unknown
What I would like to be able to do in my template is echo a string based on which box returns checked, something like:
if (checkbox == yes) {
echo "If you wish to make";
} elseif (checkbox == no) {
echo "an apple pie from scratch,";
} else {
echo "you must first invent the universe";
}
But I cant make it work :(
This (and many ridiculous variations on this) just returns 'yes' instead of the echo.
if ($provenance_mb->the_value('docposs') == yes) {
echo 'hello world';
}
Any help would be appreciated.