__( '(blog masonry style) Displays latest posts or posts from a choosen category.(Home page & sidebar) ', 'aazeen-extension' ), 'customize_selective_refresh' => true, ) ); $this->alt_option_name = 'aazeen_post_masonry'; } /** * 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'] ) : 'large-12'; $number_posts = ( ! empty( $instance['number_posts'] ) ) ? absint( $instance['number_posts'] ) : 3; $sticky_posts = ( isset( $instance['sticky_posts'] ) ) ? $instance['sticky_posts'] : true; $hide_posts_cat = ( isset( $instance['hide_posts_cat'] ) ) ? $instance['hide_posts_cat'] : true; $hide_autor_date = ( isset( $instance['hide_autor_date'] ) ) ? $instance['hide_autor_date'] : true; $category = ( isset( $instance['category'] ) ) ? absint( $instance['category'] ) : ''; $bg_color = isset( $instance['bg_color'] ) ? $instance['bg_color'] : '#E8EBF2'; $content_bgimage = isset( $instance['content_bgimage'] ) ? $instance['content_bgimage'] : ''; $fixed_bg = isset( $instance['fixed_bg'] ) ? $instance['fixed_bg'] : false; // 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, 'ignore_sticky_posts' => 1, ) ); echo $before_widget; ?> id; ?>
$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'); ?>" />
class="checkbox" id="get_field_id('hide_posts_cat'); ?>" name="get_field_name('hide_posts_cat'); ?>" />
class="checkbox" id="get_field_id('hide_autor_date'); ?>" name="get_field_name('hide_autor_date'); ?>" />
id="get_field_id( 'fixed_bg' ); ?>" name="get_field_name( 'fixed_bg' ); ?>" />