__('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 { function kad_contact_widget() { $widget_ops = array('classname' => 'widget_kadence_contact', 'description' => __('Use this widget to add a Vcard to your site', 'pinnacle')); $this->__construct('widget_kadence_contact', __('Pinnacle: Contact/Vcard', 'pinnacle'), $widget_ops); $this->alt_option_name = 'widget_kadence_contact'; add_action('save_post', array(&$this, 'flush_widget_cache')); add_action('deleted_post', array(&$this, 'flush_widget_cache')); add_action('switch_theme', array(&$this, 'flush_widget_cache')); } function widget($args, $instance) { $cache = wp_cache_get('widget_kadence_contact', 'widget'); if (!is_array($cache)) { $cache = array(); } 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, EXTR_SKIP); $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 $before_widget; if ($title) { echo $before_title; echo $title; echo $after_title; } ?>

flush_widget_cache(); $alloptions = wp_cache_get('alloptions', 'options'); if (isset($alloptions['widget_kadence_contact'])) { delete_option('widget_kadence_contact'); } return $instance; } function flush_widget_cache() { wp_cache_delete('widget_kadence_contact', 'widget'); } function form($instance) { $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; $company = isset($instance['company']) ? esc_attr($instance['company']) : ''; $name = isset($instance['name']) ? esc_attr($instance['name']) : ''; $street_address = isset($instance['street_address']) ? esc_attr($instance['street_address']) : ''; $locality = isset($instance['locality']) ? esc_attr($instance['locality']) : ''; $region = isset($instance['region']) ? esc_attr($instance['region']) : ''; $postal_code = isset($instance['postal_code']) ? esc_attr($instance['postal_code']) : ''; $tel = isset($instance['tel']) ? esc_attr($instance['tel']) : ''; $fixedtel = isset($instance['fixedtel']) ? esc_attr($instance['fixedtel']) : ''; $email = isset($instance['email']) ? esc_attr($instance['email']) : ''; ?>

'widget_kadence_social', 'description' => __('Simple way to add Social Icons', 'pinnacle')); $this->__construct('widget_kadence_social', __('Pinnacle: Social Links', 'pinnacle'), $widget_ops); $this->alt_option_name = 'widget_kadence_social'; add_action('save_post', array(&$this, 'flush_widget_cache')); add_action('deleted_post', array(&$this, 'flush_widget_cache')); add_action('switch_theme', array(&$this, 'flush_widget_cache')); } function widget($args, $instance) { $cache = wp_cache_get('widget_kadence_social', 'widget'); if (!is_array($cache)) { $cache = array(); } 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, 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; } ?>
flush_widget_cache(); $alloptions = wp_cache_get('alloptions', 'options'); if (isset($alloptions['widget_kadence_social'])) { delete_option('widget_kadence_social'); } return $instance; } function flush_widget_cache() { wp_cache_delete('widget_kadence_social', 'widget'); } function form($instance) { $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; $facebook = isset($instance['facebook']) ? esc_attr($instance['facebook']) : ''; $twitter = isset($instance['twitter']) ? esc_attr($instance['twitter']) : ''; $instagram = isset($instance['instagram']) ? esc_attr($instance['instagram']) : ''; $googleplus = isset($instance['googleplus']) ? esc_attr($instance['googleplus']) : ''; $flickr = isset($instance['flickr']) ? esc_attr($instance['flickr']) : ''; $vimeo = isset($instance['vimeo']) ? esc_attr($instance['vimeo']) : ''; $youtube = isset($instance['youtube']) ? esc_attr($instance['youtube']) : ''; $pinterest = isset($instance['pinterest']) ? esc_attr($instance['pinterest']) : ''; $dribbble = isset($instance['dribbble']) ? esc_attr($instance['dribbble']) : ''; $linkedin = isset($instance['linkedin']) ? esc_attr($instance['linkedin']) : ''; $tumblr = isset($instance['tumblr']) ? esc_attr($instance['tumblr']) : ''; $vk = isset($instance['vk']) ? esc_attr($instance['vk']) : ''; $rss = isset($instance['rss']) ? esc_attr($instance['rss']) : ''; ?>

'kadence_recent_posts', 'description' => __('This shows the most recent posts on your site with a thumbnail', 'pinnacle')); $this->__construct('kadence_recent_posts', __('Pinnacle: Recent Posts', 'pinnacle'), $widget_ops); $this->alt_option_name = 'kadence_recent_entries'; add_action( 'save_post', array(&$this, 'flush_widget_cache') ); add_action( 'deleted_post', array(&$this, 'flush_widget_cache') ); add_action( 'switch_theme', array(&$this, 'flush_widget_cache') ); } function widget($args, $instance) { $cache = wp_cache_get('kadence_recent_posts', 'widget'); if ( !is_array($cache) ) $cache = array(); 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', '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()) : ?> flush_widget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); if ( isset($alloptions['kadence_recent_entries']) ) delete_option('kadence_recent_entries'); return $instance; } function flush_widget_cache() { wp_cache_delete('kadence_recent_posts', 'widget'); } function form( $instance ) { $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; $number = isset($instance['number']) ? absint($instance['number']) : 5; if (isset($instance['thecate'])) { $thecate = esc_attr($instance['thecate']); } else {$thecate = '';} $categories= get_categories(); $cate_options = array(); $cate_options[] = ''; 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')); $this->__construct('kadence_image_grid', __('Pinnacle: Post Grid', 'pinnacle'), $widget_ops); $this->alt_option_name = 'kadence_image_grid'; add_action( 'save_post', array(&$this, 'flush_widget_cache') ); add_action( 'deleted_post', array(&$this, 'flush_widget_cache') ); add_action( 'switch_theme', array(&$this, 'flush_widget_cache') ); } function widget($args, $instance) { $cache = wp_cache_get('kadence_image_grid', 'widget'); if ( !is_array($cache) ) $cache = array(); 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']) ? '' : $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 ) ) { ?>
flush_widget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); if ( isset($alloptions['kadence_image_grid']) ) delete_option('kadence_image_grid'); return $instance; } function flush_widget_cache() { wp_cache_delete('kadence_image_grid', 'widget'); } function form( $instance ) { $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; $gridchoice = isset($instance['gridchoice']) ? esc_attr($instance['gridchoice']) : ''; $number = isset($instance['number']) ? absint($instance['number']) : 6; if (isset($instance['thecat'])) { $thecat = esc_attr($instance['thecat']); } else {$thecat = '';} if (isset($instance['thetype'])) { $thetype = esc_attr($instance['thetype']); } else {$thetype = '';} $types= get_terms('portfolio-type'); $type_options = array(); $type_options[] = ''; 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')); $this->__construct('kadence_simple_image', __('Pinnacle: Image', 'pinnacle'), $widget_ops); $this->alt_option_name = 'kadence_simple_image'; } 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); ?> '; }?>

flush_widget_cache(); return $instance; } function flush_widget_cache() { wp_cache_delete('kadence_simple_image', 'widget'); } public function form($instance){ $image_uri = isset($instance['image_uri']) ? esc_attr($instance['image_uri']) : ''; $image_link = isset($instance['image_link']) ? esc_attr($instance['image_link']) : ''; if (isset($instance['image_link_open'])) { $image_link_open = esc_attr($instance['image_link_open']); } else {$image_link_open = 'lightbox';} $link_options = array(); $link_options_array = array(); $link_options[] = array("slug" => "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[] = ''; } ?>