esc_html__( 'A widget that displays the posts of your blog', 'artcela' ), )
);
}
public function widget( $args, $instance ) {
extract( $args );
//Our variables from the widget settings.
//$title = apply_filters('widget_title', $instance['title'] );
$posts = $instance['posts'];
$show_thumb = (int) $instance['show_thumb'];
$show_date = (int) $instance['show_date'];
$select = isset( $instance['select'] ) ? $instance['select'] : '';
echo wp_kses($before_widget,artcela_allow_html() );
/*if ( $title ) {
// echo '
';
}*/
?>
$select,
'posts_per_page' => 1,
'orderby' => 'comment_count',
'order' => 'DESC',
'ignore_sticky_posts' => '1',
);
$popularposts = new WP_Query( $args );
if($popularposts->have_posts()) : while ($popularposts->have_posts()) : $popularposts->the_post();
?>
esc_html__('Featured Posts', 'artcela'),
'posts' => 5,
'show_thumb' => 1,
'show_date' => 0,
'select' => '',
);
$instance = wp_parse_args( (array) $instance, $defaults );
$show_thumb = isset( $instance[ 'show_thumb' ] ) ? esc_attr( $instance[ 'show_thumb' ] ) : 1;
$show_date = isset( $instance[ 'show_date' ] ) ? esc_attr( $instance[ 'show_date' ] ) : 1;
// Widget Title: Text Input
?>
-1
)
);
// we need the array of posts
$posts_array = $post_type_query->posts;
// create a list with needed information
// the key equals the ID, the value is the post_title
$options = wp_list_pluck( $posts_array, 'post_title', 'ID' );
?>