__('Contact details', 'best'), 'classname' => 'widget_bestwp_contact', ), array('width' => 400, 'height' => 350) ); } function widget( $args, $instance ) { extract($args); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __('Contact','best') : $instance['title'], $instance, $this->id_base ); $company = empty( $instance['company'] ) ? 'Company' : $instance['company']; $text = empty( $instance['text'] ) ? "Address\nCity, State Zip\n 123 456 7890\n 123 456 7890\nemail@address.com" : $instance['text']; echo $before_widget; if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
'Contact', 'text' => "Address\nCity, State Zip\n 123 456 7890\n 123 456 7890\nemail@address.com", 'company' => 'Company', 'filter' => 1 ) ); $title = strip_tags($instance['title']); $text = esc_textarea($instance['text']); $company = strip_tags($instance['company']); $filter = $instance['filter']; ?>

/> 

__('A list of categories', 'best'), 'classname' => 'widget_bestwp_categories', ) ); } function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Categories','best') : $instance['title'], $instance, $this->id_base); echo $before_widget; if (!empty($title)) echo $before_title . $title . $after_title; ?> '')); $title = esc_attr($instance['title']); ?>

__('A list of Flickr images', 'best'), 'classname' => 'widget_bestwp_flickr', ) ); } function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Flickr widget','best') : $instance['title'], $instance, $this->id_base); $user = empty($instance['user']) ? '97073871@N04' : $instance['user']; if (empty($instance['number']) || !$number = absint($instance['number'])) $number = 12; echo $before_widget; if (!empty($title)) echo $before_title . $title . $after_title; ?>
'')); $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; $user = isset($instance['user']) ? esc_attr($instance['user']) : '97073871@N04'; $number = isset($instance['number']) ? absint($instance['number']) : 12; ?>

__('A list of the latest posts', 'best'), 'classname' => 'widget_bestwp_latest_posts', ) ); $this->alt_option_name = 'widget_bestwp_latest_posts_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('widget_bestwp_latest_posts_cache', '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']) ? __('Latest Posts','best') : $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, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true))); if ($r->have_posts()) : ?>
have_posts()) : $r->the_post(); ?>
'; ?>
have_posts()): ?>
flush_widget_cache(); $alloptions = wp_cache_get('alloptions', 'options'); if (isset($alloptions['widget_bestwp_latest_posts_entries'])) delete_option('widget_bestwp_latest_posts_entries'); return $instance; } function flush_widget_cache() { wp_cache_delete('widget_bestwp_latest_posts_cache', 'widget'); } function form($instance) { $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; $number = isset($instance['number']) ? absint($instance['number']) : 5; ?>

__('A gallery of images', 'best'), 'classname' => 'widget_bestwp_sidebar_gallery', ) ); } function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Sidebar Gallery','best') : $instance['title'], $instance, $this->id_base); $category = $instance['category']; echo $before_widget; if (!empty($title)) echo $before_title . $title . $after_title; ?>
$instance['number'], 'category' => $instance['category'], 'orderby' => 'post_date', 'order' => 'DESC', 'meta_key' => '_thumbnail_id', 'post_type' => 'post', 'post_status' => 'publish', 'suppress_filters' => true ); $query = get_posts($args); foreach($query as $q){ echo '
'; echo ''; echo get_the_post_thumbnail($q->ID); echo ''; echo '
'; } } ?>
'', 'category' => '')); $title = esc_attr($instance['title']); $category = esc_attr($instance['category']); $number = isset($instance['number']) ? absint($instance['number']) : 9; ?>

__('A list of recent works', 'best'), 'classname' => 'widget_bestwp_recent_works', ) ); } function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Works','best') : $instance['title'], $instance, $this->id_base); $category = $instance['category']; echo $before_widget; if (!empty($title)) echo $before_title . $title . $after_title; ?>
$instance['number'], 'category' => $instance['category'], 'orderby' => 'post_date', 'order' => 'DESC', 'meta_key' => '_thumbnail_id', 'post_type' => 'post', 'post_status' => 'publish', 'suppress_filters' => true ); $query = get_posts($args); foreach($query as $q){ echo '
'; echo ''; echo '
'; echo $q->post_excerpt; echo '
'; echo '
'; } } ?>
'', 'category' => '')); $title = esc_attr($instance['title']); $category = esc_attr($instance['category']); $number = isset($instance['number']) ? absint($instance['number']) : 5; ?>