__('(Recent Post) Displays latest posts or posts from a choosen category. ', 'blogs-up'), 'customize_selective_refresh' => true, ) ); } /** * Display Widget * * @param $args * @param $instance */ function widget($args, $instance) { extract($args); $number_posts = (!empty($instance['number_posts'])) ? absint($instance['number_posts']) : 4; if (!$number_posts) { $number_posts = 4; } $sticky_posts = isset($instance['sticky_posts']) ? $instance['sticky_posts'] : false; $category = (isset($instance['category'])) ? absint($instance['category']) : ''; echo $before_widget; ?>

$category, 'posts_per_page' => $number_posts, 'post_status' => 'publish', 'ignore_sticky_posts' => $sticky_posts, ) ); ?>
have_posts()) : while ($recent_list_posts->have_posts()) : $recent_list_posts->the_post(); ?>
'show_option_all', 'title' => 'Latest News', ); $number_posts = isset($instance['number_posts']) ? absint($instance['number_posts']) : 4; $sticky_posts = isset($instance['sticky_posts']) ? (bool) $instance['sticky_posts'] : false; $instance = wp_parse_args((array) $instance, $defaults); ?>

'Show all posts', 'orderby' => 'ID', 'order' => 'ASC', 'show_count' => 1, 'hide_empty' => 1, 'selected' => $instance['category'], 'hierarchical' => 0, 'name' => $this->get_field_name('category'), 'taxonomy' => 'category', 'value_field' => 'term_id', ); ?>

id="get_field_id('sticky_posts'); ?>" name="get_field_name('sticky_posts'); ?>" />