__( '(blog carousel style) Displays latest posts or posts from a choosen category.(Home page & sidebar) ', 'aazeen-extension' ), ) ); $this->alt_option_name = 'aazeen_ex_post_carousel'; add_action('wp_enqueue_scripts', array(&$this, 'aazeen_ex_latest_post_carousel_style')); } /** * Display Widget * * @param $args * @param $instance */ function widget($args, $instance) { extract($args); $auto_play = ( ! empty( $instance['auto_play'] ) ) ? wp_kses_post( $instance['auto_play'] ) : ''; $slidesto_show = ( ! empty( $instance['slidesto_show'] ) ) ? absint( $instance['slidesto_show'] ) : 3; $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'] ) : ''; $bg_color = isset( $instance['bg_color'] ) ? $instance['bg_color'] : '#BCBDD4'; $content_bgimage = isset( $instance['content_bgimage'] ) ? $instance['content_bgimage'] : ''; $showcase_link = isset( $instance[ 'bg_position' ]) ? $instance['bg_position'] : ''; // 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; ?> id.'">';?>

'show_option_all', 'title' => 'Latest Blog ', 'sticky_posts' => 'true', 'number_posts' => '5', 'slidesto_show'=>'3', 'auto_play'=>'true', 'bg_color' => '#fff', 'main_title' => 'Amazing Team', 'title_color' => '#0a0a0a', 'subtitle_color' => '#747474', 'bg_position'=>'off', ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

$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'); ?>" />

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

option_name ); if ( empty( $settings ) ) { return; } foreach ( $settings as $instance_id => $instance ) { $id = $this->id_base . '-' . $instance_id; if ( ! is_active_widget( false, $id, $this->id_base ) ) { continue; } $title_color=esc_html($instance['title_color']); $id= $this->id; $widget_style=''; /* Color calculation for text */ $widget_style .= " #".$id." .separator-center::after { border-bottom-color: $title_color ; }" ; wp_add_inline_style( 'aazeen-style', $widget_style ); } } } } // register aazeen_ex dual category posts widget function aazeen_ex_latest_post_carousel() { register_widget( 'aazeen_ex_post_carousel' ); } add_action( 'widgets_init', 'aazeen_ex_latest_post_carousel' );