'bmag_widget_columns_cats', 'description' => __( 'Displays the latest posts of two specific categories (each category in a column). This widget must use it ONLY on the MAGAZINE FRONT PAGE.', 'bmag' ), ); parent::__construct( 'Bmag_Widget_Columns_Cats', '(BMag) ' . __( 'Two Columns', 'bmag' ), $widget_ops ); } public function form( $instance ) { ?> '', 'cat_sel_left' => '', 'title_right' => '', 'cat_sel_right' => '', 'n_posts' => '3', 'mostrar_excerpt' => '', ); $instance = wp_parse_args( (array) $instance, $defaults ); $title_left = $instance ['title_left']; $cat_sel_left = $instance['cat_sel_left']; $title_right = $instance ['title_right']; $cat_sel_right = $instance['cat_sel_right']; $n_posts = $instance ['n_posts']; $mostrar_excerpt = $instance ['mostrar_excerpt']; ?>


:


:

:  

/>

id_base ) : ''; $cat_sel_left = ! empty( $instance['cat_sel_left'] ) ? $instance['cat_sel_left'] : ''; $title_right = ! empty( $instance['title_right'] ) ? apply_filters( 'widget_title', $instance['title_right'], $instance, $this->id_base ) : ''; $cat_sel_right = ! empty( $instance['cat_sel_right'] ) ? $instance['cat_sel_right'] : ''; $n_posts = ! empty( $instance['n_posts'] ) ? $instance['n_posts'] : 3; $mostrar_excerpt = ! empty( $instance['mostrar_excerpt'] ) ? $instance['mostrar_excerpt'] : ''; /* COLUMNA IZQUIERDA */ $args_left = array( 'post__not_in' => get_option( 'sticky_posts' ), 'posts_per_page' => $n_posts, 'cat' => $cat_sel_left, ); $query_left = new WP_Query( $args_left ); if ( $query_left->have_posts() ) : $num = $this->number; ?>
have_posts() ) : $query_left->the_post(); $current_post = $query_left->current_post; if ( $current_post == 0 ) { ?>
', '' ); ?>
', '' ); ?>
get_option( 'sticky_posts' ), 'posts_per_page' => $n_posts, 'cat' => $cat_sel_right, ); $query_right = new WP_Query( $args_right ); if ( $query_right->have_posts() ) : ?>
have_posts() ) : $query_right->the_post(); $current_post = $query_right->current_post; if ( $current_post == 0 ) { ?>
', '' ); ?>
', '' ); ?>