'two-column-posts ascendoor-widget style-2', 'description' => __( 'Retrive Two Column Posts Widgets', 'authentic-news' ), ); parent::__construct( 'ace_news_two_column_widget', __( 'Ascendoor Two Column Posts Widget', 'authentic-news' ), $ace_news_two_column_posts_widget_ops ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } $two_column_posts_offset = isset( $instance['offset'] ) ? absint( $instance['offset'] ) : ''; echo $args['before_widget']; ?>
id_base ); $two_column_posts_category = isset( $instance[ 'category_' . $i ] ) ? absint( $instance[ 'category_' . $i ] ) : ''; ?>
'post', 'posts_per_page' => absint( 4 ), 'offset' => absint( $two_column_posts_offset ), 'cat' => absint( $two_column_posts_category ), ); $query = new WP_Query( $two_column_posts_widgets_args ); if ( $query->have_posts() ) : $j = 1; while ( $query->have_posts() ) : $query->the_post(); $classes = $j === 1 ? 'grid-layout' : 'list-layout'; ?>