__('Primary Sidebar', 'pinnacle'), 'id'=>'sidebar-primary')); global $pinnacle; if(isset($pinnacle['cust_sidebars'])) { if (is_array($pinnacle['cust_sidebars'])) { $i = 1; foreach($pinnacle['cust_sidebars'] as $sidebar){ if(empty($sidebar)) {$sidebar = 'sidebar'.$i;} $all_sidebars[]=array('name'=>$sidebar, 'id'=>'sidebar'.$i); $i++; } } } global $kad_sidebars; $kad_sidebars = $all_sidebars; return $all_sidebars; } add_action('init', 'pinnacle_sidebar_list'); function pinnacle_register_sidebars(){ $the_sidebars = pinnacle_sidebar_list(); if (function_exists('register_sidebar')){ foreach($the_sidebars as $side){ pinnacle_register_sidebar($side['name'], $side['id']); } } } function pinnacle_register_sidebar($name, $id){ register_sidebar(array('name'=>$name, 'id' => $id, 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', )); } add_action('widgets_init', 'pinnacle_register_sidebars'); function pinnacle_widgets_init() { //Topbar if(pinnacle_display_topbar_widget()) { register_sidebar(array( 'name' => __('Topbar Widget', 'pinnacle'), 'id' => 'topbarright', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', )); } // Sidebars register_sidebar(array( 'name' => __('Primary Sidebar', 'pinnacle'), 'id' => 'sidebar-primary', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', )); // Footer global $pinnacle; if(isset($pinnacle['footer_layout'])) { $footer_layout = $pinnacle['footer_layout'];} else {$footer_layout = "fourc";} if ($footer_layout == "fourc") { if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column 1', 'pinnacle'), 'id' => 'footer_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

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

', 'after_title' => '

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

', 'after_title' => '

', ) ); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column 4', 'pinnacle'), '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', 'pinnacle'), 'id' => 'footer_third_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

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

', 'after_title' => '

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

', 'after_title' => '

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

', 'after_title' => '

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

', 'after_title' => '

', ) ); } // Widgets register_widget('kad_contact_widget'); register_widget('kad_social_widget'); register_widget('kad_recent_posts_widget'); register_widget('kad_post_grid_widget'); register_widget('kad_image_widget'); } add_action('widgets_init', 'pinnacle_widgets_init'); /** * Contact widget */ class kad_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', 'pinnacle')); parent::__construct('widget_kadence_contact', __('Pinnacle: Contact/Vcard', 'pinnacle'), $widget_ops); } public function widget($args, $instance) { $title = apply_filters('widget_title', empty($instance['title']) ? '' : $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 $args['before_widget']; if ($title) { echo $args['before_title']; echo $title; echo $args['after_title']; } ?>

'widget_kadence_social', 'description' => __('Simple way to add Social Icons', 'pinnacle')); parent::__construct('widget_kadence_social', __('Pinnacle: Social Links', 'pinnacle'), $widget_ops); } function widget($args, $instance) { if (!isset($args['widget_id'])) { $args['widget_id'] = null; } ob_start(); extract($args, EXTR_SKIP); $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', 'pinnacle')); parent::__construct('kadence_recent_posts', __('Pinnacle: Recent Posts', 'pinnacle'), $widget_ops); } public function widget($args, $instance) { if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = $this->id; ob_start(); extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', 'pinnacle') : $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', 'pinnacle')); parent::__construct('kadence_image_grid', __('Pinnacle: Post Grid', 'pinnacle'), $widget_ops); } public function widget($args, $instance) { if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = $this->id; ob_start(); extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $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[] = ''; } ?>

'kadence_simple_image', 'description' => __('This allows for an image and a simple about text.', 'pinnacle')); parent::__construct('kadence_simple_image', __('Pinnacle: Image', 'pinnacle'), $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 = 'data-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"'; } $image_id = attachment_url_to_postid( $instance['image_uri'] ); if(isset($image_id) && $image_id != '0') { $alt_text = get_post_meta($image_id, '_wp_attachment_image_alt', true); } else { $alt_text = ''; } ?>
';} ?> <?php echo esc_attr($alt_text); ?> '; }?>

"lightbox", "name" => __('Lightbox', 'pinnacle')); $link_options[] = array("slug" => "_blank", "name" => __('New Window', 'pinnacle')); $link_options[] = array("slug" => "_self", "name" => __('Same Window', 'pinnacle')); $link_options[] = array("slug" => "none", "name" => __('No Link', 'pinnacle')); foreach ($link_options as $link_option) { if ($image_link_open == $link_option['slug']) { $selected=' selected="selected"';} else { $selected=""; } $link_options_array[] = ''; } ?>