Creating a check-box

 In
<?php function sm_custom_meta() { add_meta_box( 'sm_meta', __( 'Featured Posts', 'sm-textdomain' ), 'sm_meta_callback', 'post' ); } function sm_meta_callback( $post ) { $featured = get_post_meta( $post->ID ); ?> <p> <div class="sm-row-content"> <label for="meta-checkbox"> <input type="checkbox" name="meta-checkbox" id="meta-checkbox" value="yes" <?php if ( isset ( $featured['meta-checkbox'] ) ) checked( $featured['meta-checkbox'][0], 'yes' ); ?> /> <?php _e( 'Featured this post', 'sm-textdomain' )?> </label> </div> </p> <?php } add_action( 'add_meta_boxes', 'sm_custom_meta' ); ?>
Recent Posts
Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt