__('Primary Sidebar', 'backyard'), 'id'=> 'primary-sidebar', 'before_widget'=> '', 'before_title'=> '

', 'after_title'=> '

', )); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column One', 'backyard'), 'id' => 'footer_1', 'before_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column Two', 'backyard'), 'id' => 'footer_2', 'before_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column Three', 'backyard'), 'id' => 'footer_3', 'before_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column Four', 'backyard'), 'id' => 'footer_4', 'before_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); // Widgets register_widget('Backyard_Social_Widget'); register_widget('Backyard_Recent_Posts_Widget'); register_widget('Backyard_Popular_Posts_Widget'); register_widget('About_With_Image'); } add_action('widgets_init', 'backyard_widgets_init'); /** * Social widget */ class Backyard_Social_Widget extends WP_Widget { private static $instance = 0; public function __construct() { $widget_ops = array('classname' => 'widget_backyard_social', 'description' => __('Simple way to add Social Icons', 'backyard')); parent::__construct('widget_backyard_social', __('Backyard: Social Links', 'backyard'), $widget_ops); } function widget($args, $instance) { if (!isset($args['widget_id'])) { $args['widget_id'] = null; } if (isset($cache[$args['widget_id']])) { echo $cache[$args['widget_id']]; return; } ob_start(); extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); if (!isset($instance['facebook'])) { $instance['facebook'] = ''; } if (!isset($instance['twitter'])) { $instance['twitter'] = ''; } if (!isset($instance['instagram'])) { $instance['instagram'] = ''; } if (!isset($instance['googleplus'])) { $instance['googleplus'] = ''; } if (!isset($instance['flickr'])) { $instance['flickr'] = ''; } if (!isset($instance['vimeo'])) { $instance['vimeo'] = ''; } if (!isset($instance['youtube'])) { $instance['youtube'] = ''; } if (!isset($instance['pinterest'])) { $instance['pinterest'] = ''; } if (!isset($instance['dribbble'])) { $instance['dribbble'] = ''; } if (!isset($instance['linkedin'])) { $instance['linkedin'] = ''; } if (!isset($instance['tumblr'])) { $instance['tumblr'] = ''; } if (!isset($instance['vk'])) { $instance['vk'] = ''; } if (!isset($instance['rss'])) { $instance['rss'] = ''; } echo $before_widget; if ($title) { echo $before_title; echo $title; echo $after_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(); ?>
'img-responsive','alt' => get_the_title() )); ?>

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(); ?>
'img-responsive','alt' => get_the_title() )); ?>

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 = '#';} ?>

MORE ABOUT ME