__( 'A Recent Post Widget', 'zeitfresser' ), ) // Args ); } /** * 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 ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Recent Posts', 'zeitfresser' ); $num_post = ! empty( $instance['num_post'] ) ? $instance['num_post'] : 3 ; $show_thumb = ! empty( $instance['show_thumbnail'] ) ? $instance['show_thumbnail'] : ''; $show_date = ! empty( $instance['show_postdate'] ) ? $instance['show_postdate'] : ''; $cats[] = ''; $cat = apply_filters( 'daisy_blog_pro_exclude_categories', $cats ); $style = ! empty( $instance['style'] ) ? $instance['style'] : 'style-one'; $target = 'target="_self"'; if( isset($instance['target']) && $instance['target']!='' ){ $target = 'target="_blank"'; } $obj = new Graphthemes_Widget_Functions; $daisy_blog_recent_post_size = apply_filters('daisy_blog_recent_post_size', 'thumbnail'); $qry = new WP_Query( array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $num_post, 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'category__not_in' => $cat ) ); if( $qry->have_posts() ){ echo $args['before_widget']; ob_start(); if( $title ) echo $args['before_title'] . apply_filters( 'widget_title', $title, $instance, $this->id_base ) . $args['after_title']; ?>

/>

/>