__('Primary Sidebar', 'backyard'), 'id'=> 'primary-sidebar', 'before_widget'=> '', 'before_title'=> '
'backyard_popular_posts', 'description' => __('This shows the most popular posts on your site with a thumbnail', 'backyard')); parent::__construct('backyard_popular_posts', __('Backyard: Popular Posts', 'backyard'), $widget_ops); } function widget($args, $instance) { if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = $this->id; if ( isset( $cache[ $args['widget_id'] ] ) ) { echo $cache[ $args['widget_id'] ]; return; } ob_start(); extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Popular Posts', 'backyard') : $instance['title'], $instance, $this->id_base); if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) $number = 10; $popular_posts = new WP_Query(apply_filters( 'widget_posts_args', array( 'posts_per_page' => $number, 'category_name' => $instance['thecate'], 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true,'meta_key' => 'wpb_post_views_count', 'orderby' => 'meta_value_num', 'order' => 'DESC') ) ); if ($popular_posts->have_posts()) : ?> have_posts()) : $popular_posts->the_post(); ?> All'; foreach ($categories as $cate) { if ($thecate==$cate->slug) { $selected=' selected="selected"';} else { $selected=""; } $cate_options[] = ''; } ?>
'backyard_recent_posts', 'description' => __('This shows the most recent posts on your site with a thumbnail', 'backyard')); parent::__construct('backyard_recent_posts', __('Backyard: Recent Posts', 'backyard'), $widget_ops); } function widget($args, $instance) { if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = $this->id; if ( isset( $cache[ $args['widget_id'] ] ) ) { echo $cache[ $args['widget_id'] ]; return; } ob_start(); extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', 'backyard') : $instance['title'], $instance, $this->id_base); if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) $number = 10; $recent_posts = new WP_Query( apply_filters( 'widget_posts_args', array( 'posts_per_page' => $number, 'category_name' => $instance['thecate'], 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ) ) ); if ($recent_posts->have_posts()) : ?> have_posts()) : $recent_posts->the_post(); ?> All'; foreach ($categories as $cate) { if ($thecate==$cate->slug) { $selected=' selected="selected"';} else { $selected=""; } $cate_options[] = ''; } ?>
'backyard_about_with_image', 'description' => __('This allows for an image and a simple about text.', 'backyard')); parent::__construct('backyard_about_with_image', __('Backyard: About With Image', 'backyard'), $widget_ops); } public function widget($args, $instance){ extract( $args ); if(!empty($instance['more_about_me_link'])) {$more_about_me_link = $instance['more_about_me_link'];} else {$more_about_me_link = '#';} ?>