If Checkbox Checked – Do Something

<input type="checkbox" name="external_link" <?php if( $external_link == true ) { ?>checked="checked" <?php } ?> />
Check if External Link (<em>http://www.example.com</em>)  

<?php wp_nonce_field('save_widget_settings_nonce','save_widget_settings_nonce'); ?>  

$external_link = get_post_meta($post->ID,'external_link',true);  
if($external_link) { ?> 

<div class="widget_title"> <a href="<?php echo $link; ?>" target="_blank">
<?php echo get_the_title(); ?></a> </div> 

<?php } else { ?>  

<div class="widget_title"> <a href="<?php echo $link; ?>"><?php echo get_the_title(); ?></a> </div> 

<?php } ?>

Leave a Reply

Posted in php
katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.