add_meta_box …as a checkbox
-
Hi,
I’m adding some meta boxes to some custom content. One of them I would like to be a simple yes/no checkbox to make a post be featured on the front. I’ve been following this tutorial: https://thinkvitamin.com/code/create-your-first-wordpress-custom-post-type/
Ii’ve done a lot of searching for checkboxes, but all the support and tutorials i’ve found is for multiple checkboxes. I only need one.
So my question is how to turn this:
function front_event(){ global $post; $custom = get_post_custom($post->ID); $front_event = $custom["front_event"][0]; ?> <label>Place Event On Front Page? (type yes):</label> <input name="front_event" value="<?php echo $front_event; ?>" /> <?php }
into proper code for a single yes/no checkbox.
Thanks.
Nadine
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘add_meta_box …as a checkbox’ is closed to new replies.