Example #1
0
    /**
     * Outputs the content of the widget
     *
     * @param array $args
     * @param array $instance
     */
    public function widget($args, $instance)
    {
        // outputs the content of the widget
        extract($args);
        $dbi_args = array('post_type' => 'highlight', 'order' => 'ASC', 'posts_per_page' => 4);
        $query = new WP_Query($dbi_args);
        ?>
<div class="small-up-1 medium-up-2 large-up-4 highlight-grid">
	<?php 
        while ($query->have_posts()) {
            $query->the_post();
            $asoc_link = lorainccc_high_light_box_get_meta('lorainccc_lccc_highlight_box_link');
            if ($asoc_link == '') {
                $asoc_link = 'http://www.lorainccc.edu/';
            }
            ?>
				<div class="column link-box text-center">
							<a href="<?php 
            echo $asoc_link;
            ?>
" class="box-link">
								<?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail();
            } else {
                ?>
															<img src="<?php 
                bloginfo('stylesheet_directory');
                ?>
/images/hp_smsquares_radiology.jpg" alt="" />
												<?php 
            }
            ?>
							 <?php 
            $bgcolor = lorainccc_high_light_box_get_meta('lorainccc_lccc_highlight_box_bg_color');
            if ($bgcolor == '') {
                $bgcolor = '#000000';
            }
            ?>
	
								<div style="background:<?php 
            echo $bgcolor;
            ?>
" class="link-box-label"><?php 
            the_title();
            ?>
</div>
								</a>
      </div>
	<?php 
        }
        ?>
</div>
<?php 
    }
function lorainccc_high_light_box_html($post)
{
    wp_nonce_field('_lorainccc_high_light_box_nonce', 'lorainccc_high_light_box_nonce');
    ?>
	
<script>
jQuery(document).ready(function(){
jQuery('#event_start_date').datepicker({
	dateFormat: "yy-mm-dd"
});
jQuery('#event_start_time').timepicker({
	timeFormat: "hh:mm tt"
});
jQuery('#event_end_date').datepicker({
	dateFormat: "yy-mm-dd"
});
jQuery('#event_end_time').timepicker({
	timeFormat: "hh:mm tt"
});	

});
</script>

<h4>Associated Link:</h4>
	<p>
		<label for="lorainccc_high_light_box_link"><?php 
    _e('Associated Link', 'lorainccc_high_light_box');
    ?>
</label><br>
		<input class="widefat" type="text" name="lorainccc_high_light_box_link" id="lorainccc_high_light_box_link" value="<?php 
    echo lorainccc_high_light_box_get_meta('lorainccc_high_light_box_link');
    ?>
">
	
	</p>	

<?php 
}