‘A slider plugin that displays three posts, one next to the other (three columns), purple background, white letter, which takes the posts from the vitrine category.’,
)
);
}
public function widget($args, $instance) {
$posts = get_posts(array(
‘category’ => ‘geral’,
‘numberposts’ => 3,
));
$output = ”;
foreach ($posts as $post) {
$output .= ‘
‘;
}
echo $output;
}
public function update($new_instance, $old_instance) {
$instance = $old_instance;
return $instance;
}
public function form($instance) {
// No settings to edit
}
}
function register_slider_plugin() {
register_widget(‘SliderPlugin’);
}
add_action(‘widgets_init’, ‘register_slider_plugin’);