radio button in Custom Field Template plugin
-
Hello, I’m trying to get radio buttons to work.
This is how I get my custom field values normally:
<?php $custom_value = get_post_meta($post->ID, 'custom_value', true); if($custom_value) { ?> <span class="something">something</span> <?php } ?>
If the field is empty it does nothing, if there’s something it does something.
But now I have one radio with two values: new and updated. I’m too neophyte in php to be able to write code. Should be something like this:
<span class=" <?php $custom_value = get_post_meta($post->ID, 'custom_value', true); if($custom_value /*= updated*/) { ?> updated <?php elseif($custom_value /*= is new) { ?> new <?php else /*if it's none of these*/ { ?> nothing <?php } ?>">
All help appreciated ??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘radio button in Custom Field Template plugin’ is closed to new replies.