__('Primary Sidebar', 'virtue'), 'id'=>'sidebar-primary')); global $virtue; if(isset($virtue['cust_sidebars'])) { if (is_array($virtue['cust_sidebars'])) { $i = 1; foreach($virtue['cust_sidebars'] as $sidebar){ if(empty($sidebar)) {$sidebar = 'sidebar'.$i;} $all_sidebars[]=array('name'=>$sidebar, 'id'=>'sidebar'.$i); $i++; } } } global $vir_sidebars; $vir_sidebars = $all_sidebars; return $all_sidebars; } add_action('init', 'virtue_sidebar_list'); function virtue_register_sidebars(){ $the_sidebars = virtue_sidebar_list(); if (function_exists('register_sidebar')){ foreach($the_sidebars as $side){ virtue_register_sidebar($side['name'], $side['id']); } } } function virtue_register_sidebar($name, $id){ register_sidebar(array('name'=>$name, 'id' => $id, 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action('widgets_init', 'virtue_register_sidebars'); function kadence_widgets_init() { //Topbar if(kadence_display_topbar_widget()) { register_sidebar(array( 'name' => __('Topbar Widget', 'virtue'), 'id' => 'topbarright', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', )); } // Sidebars register_sidebar(array( 'name' => __('Primary Sidebar', 'virtue'), 'id' => 'sidebar-primary', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); // Footer global $virtue; if(isset($virtue['footer_layout'])) { $footer_layout = $virtue['footer_layout'];} else {$footer_layout = "twoc";} if ($footer_layout == "fourc") { if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column 1', 'virtue'), 'id' => 'footer_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

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

', 'after_title' => '

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

', 'after_title' => '

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

', 'after_title' => '

', ) ); } else if ($footer_layout == "threec") { if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column 1', 'virtue'), 'id' => 'footer_third_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column 2', 'virtue'), 'id' => 'footer_third_2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column 3', 'virtue'), 'id' => 'footer_third_3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } else { if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column 1', 'virtue'), 'id' => 'footer_double_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column 2', 'virtue'), 'id' => 'footer_double_2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } // Widgets register_widget('Kadence_Contact_Widget'); register_widget('Kadence_Social_Widget'); register_widget('Kadence_Recent_Posts_Widget'); register_widget('Kadence_Image_Grid_Widget'); register_widget('Simple_About_With_Image'); } add_action('widgets_init', 'kadence_widgets_init'); /** * Contact widget */ class Kadence_Contact_Widget extends WP_Widget { private static $instance = 0; public function __construct() { $widget_ops = array('classname' => 'widget_kadence_contact', 'description' => __('Use this widget to add a Vcard to your site', 'virtue')); parent::__construct('widget_kadence_contact', __('Virtue: Contact/Vcard', 'virtue'), $widget_ops); } public function widget($args, $instance) { if (!isset($args['widget_id'])) { $args['widget_id'] = null; } extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('vCard', 'virtue') : $instance['title'], $instance, $this->id_base); if (!isset($instance['company'])) { $instance['company'] = ''; } if (!isset($instance['name'])) { $instance['name'] = ''; } if (!isset($instance['street_address'])) { $instance['street_address'] = ''; } if (!isset($instance['locality'])) { $instance['locality'] = ''; } if (!isset($instance['region'])) { $instance['region'] = ''; } if (!isset($instance['postal_code'])) { $instance['postal_code'] = ''; } if (!isset($instance['tel'])) { $instance['tel'] = ''; } if (!isset($instance['fixedtel'])) { $instance['fixedtel'] = ''; } if (!isset($instance['email'])) { $instance['email'] = ''; } echo $before_widget; if ($title) { echo $before_title; echo $title; echo $after_title; } ?>

'widget_kadence_social', 'description' => __('Simple way to add Social Icons', 'virtue')); parent::__construct('widget_kadence_social', __('Virtue: Social Links', 'virtue'), $widget_ops); } public function widget($args, $instance) { if (!isset($args['widget_id'])) { $args['widget_id'] = null; } 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; } ?>

'kadence_recent_posts', 'description' => __('This shows the most recent posts on your site with a thumbnail', 'virtue')); parent::__construct('kadence_recent_posts', __('Virtue: Recent Posts', 'virtue'), $widget_ops); } public function widget($args, $instance) { if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = $this->id; extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', 'virtue') : $instance['title'], $instance, $this->id_base); if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) $number = 10; $r = 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 ($r->have_posts()) : ?> All'; foreach ($categories as $cate) { if ($thecate==$cate->slug) { $selected=' selected="selected"';} else { $selected=""; } $cate_options[] = ''; } ?>

'kadence_image_grid', 'description' => __('This shows a grid of featured images from recent posts or portfolio items', 'virtue')); parent::__construct('kadence_image_grid', __('Virtue: Image Grid', 'virtue'), $widget_ops); } public function widget($args, $instance) { if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = $this->id; extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Post Gallery', 'virtue') : $instance['title'], $instance, $this->id_base); if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) $number = 8; echo $before_widget; ?> 'portfolio', 'portfolio-type' => $instance['thetype'], 'no_found_rows' => true, 'posts_per_page' => $number, 'post_status' => 'publish', 'ignore_sticky_posts' => true ) ) ); if ($r->have_posts()) : ?>
have_posts()) : $r->the_post(); ?> ID ) ) { ?>
$number, 'category_name' => $instance['thecat'], 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ) ) ); if ($r->have_posts()) : ?>
have_posts()) : $r->the_post(); ?> ID ) ) { ?>
All'; foreach ($types as $type) { if ($thetype == $type->slug) { $selected=' selected="selected"';} else { $selected=""; } $type_options[] = ''; } $categories= get_categories(); $cat_options = array(); $cat_options[] = ''; foreach ($categories as $cat) { if ($thecat==$cat->slug) { $selected=' selected="selected"';} else { $selected=""; } $cat_options[] = ''; } ?>

'virtue_about_with_image', 'description' => __('This allows for an image and a simple about text.', 'virtue')); parent::__construct('virtue_about_with_image', __('Virtue: Image', 'virtue'), $widget_ops); } public function widget($args, $instance){ extract( $args ); if (!empty($instance['image_link_open']) && $instance['image_link_open'] == "none") { $uselink = false; $link = ''; $linktype = ''; } else if(empty($instance['image_link_open']) || $instance['image_link_open'] == "lightbox") { $uselink = true; $link = esc_url($instance['image_uri']); $linktype = 'rel="lightbox"'; } else if($instance['image_link_open'] == "_blank") { $uselink = true; if(!empty($instance['image_link'])) {$link = $instance['image_link'];} else {$link = esc_url($instance['image_uri']);} $linktype = 'target="_blank"'; } else if($instance['image_link_open'] == "_self") { $uselink = true; if(!empty($instance['image_link'])) {$link = $instance['image_link'];} else {$link = esc_url($instance['image_uri']);} $linktype = 'target="_self"'; } ?>
';} ?> '; }?>
"lightbox", "name" => __('Lightbox', 'virtue')); $link_options[] = array("slug" => "_blank", "name" => __('New Window', 'virtue')); $link_options[] = array("slug" => "_self", "name" => __('Same Window', 'virtue')); $link_options[] = array("slug" => "none", "name" => __('No Link', 'virtue')); foreach ($link_options as $link_option) { if ($image_link_open == $link_option['slug']) { $selected=' selected="selected"';} else { $selected=""; } $link_options_array[] = ''; } ?>