__( '(blog missionary style) Displays latest posts or posts from a choosen category.(Home page & sidebar) ', 'best-blog' ), 'customize_selective_refresh' => true, ) ); } /** * Display Widget * * @param $args * @param $instance */ function widget($args, $instance) { extract($args); $show_post_row = ( ! empty( $instance['show_post_row'] ) ) ? wp_kses_post( $instance['show_post_row'] ) : ''; $number_posts = ( ! empty( $instance['number_posts'] ) ) ? absint( $instance['number_posts'] ) : 3; $sticky_posts = ( isset( $instance['sticky_posts'] ) ) ? $instance['sticky_posts'] : true; $category = ( isset( $instance['category'] ) ) ? absint( $instance['category'] ) : ''; // Latest Posts 1 if (true == $sticky_posts ) : $sticky = get_option( 'sticky_posts' ); else: $sticky =''; endif; $latest_bloglist_posts = new WP_Query( array( 'cat' => $category, 'posts_per_page' => $number_posts, 'post_status' => 'publish', 'post__not_in' => $sticky, ) ); echo $before_widget; ?>
$this->get_field_name('category'), 'selected' => $instance['category'], 'show_option_all' => 'Show all posts' ) ); ?>
class="checkbox" id="get_field_id('sticky_posts'); ?>" name="get_field_name('sticky_posts'); ?>" />