Skip to content

Instantly share code, notes, and snippets.

@rozziecole
rozziecole / mh_widgets.php
Created November 5, 2016 17:58
Code for MH_slider widget
/***** Slider Widget (Homepage) *****/
class mh_slider_hp_widget extends WP_Widget {
function mh_slider_hp_widget () {
$widget_ops = array('classname' => 'mh_slider_hp', 'description' => __('Slider widget for use on homepage templates', 'mh'));
$this->WP_Widget('mh_slider_hp', __('MH Slider Widget (Homepage)', 'mh'), $widget_ops);
}
function widget($args, $instance) {
extract($args);
$postcount = empty($instance['postcount']) ? '5' : $instance['postcount'];