'widget__latest', 'description' => 'Display the latest posts.' ); parent::__construct('azurelo_latest_widget', 'Azurelo: Last posts', $widget_ops); } function form($instance) { $default = array( 'title' => 'Latest posts', 'nb_post' => '4', 'is_slider' => 'off'); $instance = wp_parse_args( (array) $instance, $default ); ?>

1) { echo '
'; } else { echo '
'; } $args = array( 'post_type' => 'post', 'showposts' => $nb_post, 'order ' => 'DESC', 'orderby ' => 'post_date', 'ignore_sticky_posts' => 1 ); $the_query = new WP_Query($args); if($the_query -> have_posts()) : while($the_query -> have_posts()) : $the_query -> the_post(); get_template_part('templates/post', 'small-latest'); endwhile; endif; wp_reset_postdata(); echo '
'; echo $after_widget; } } ?>