__('Primary Sidebar', 'abaya'), 'id' => 'sidebar-primary', 'before_widget' => '
', 'before_title' => '
', 'after_title' => '
', )); // Product Page Sidebars register_sidebar(array( 'name' => __('Product Page Sidebar', 'abaya'), 'id' => 'product_page_sidebar', 'before_widget' => '
', 'before_title' => '
', 'after_title' => '
', )); // Front Page Widget Top register_sidebar(array( 'name' => __('Front Page Widget Top', 'abaya'), 'id' => 'front_page_widget_top', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', )); // Front Page Widget Middle register_sidebar(array( 'name' => __('Front Page Widget Middle', 'abaya'), 'id' => 'front_page_widget_middle', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', )); // Footer if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column One', 'abaya'), 'id' => 'footer_1', 'before_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column Two', 'abaya'), 'id' => 'footer_2', 'before_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column Three', 'abaya'), 'id' => 'footer_3', 'before_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __('Footer Column Four', 'abaya'), 'id' => 'footer_4', 'before_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); } // Widgets register_widget('abaya_Social_Widget'); register_widget('abaya_Recent_Posts_Widget'); register_widget('About_With_Image'); register_widget('Abaya_Front_Page_Product_Widget'); add_action('widgets_init', 'abaya_widgets_init'); /** * Social widget */ class abaya_Social_Widget extends WP_Widget { function __construct() { $widget_ops = array( 'classname' => 'widget_abaya_social', 'description' => esc_html__( 'Simple way to add Social Icons', 'abaya') ); $control_ops = array( 'width' => 200, 'height' => 250 ); parent::__construct( false, $name = esc_html__('Abaya: Social Links', 'abaya' ), $widget_ops, $control_ops); } function widget($args, $instance) { $cache = wp_cache_get('widget_abaya_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; } ?>

'abaya_recent_posts', 'description' => esc_html__( 'This shows the most recent posts on your site with a thumbnail', 'abaya') ); $control_ops = array( 'width' => 200, 'height' => 250 ); parent::__construct( false, $name = esc_html__('Abaya: Recent Posts With Images', 'abaya' ), $widget_ops, $control_ops); } function widget($args, $instance) { $cache = wp_cache_get('abaya_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', 'abaya') : $instance['title'], $instance, $this->id_base); if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) $number = 5; $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(); ?>
  • ID ) ) { $image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); $thumbnailURL = $image_url[0]; $image = aq_resize($thumbnailURL, 75, 75, true); if(empty($image)) { $image = $thumbnailURL; } } else { $thumbnailURL = abaya_recentpost_widget_default_placeholder(); $image = aq_resize($thumbnailURL, 75, 75, true); if(empty($image)) { $image=$thumbnailURL; } } ?>
    '.$after_widget; ?> All'; foreach ($categories as $cate) { if ($thecate==$cate->slug) { $selected=' selected="selected"';} else { $selected=""; } $cate_options[] = ''; } ?>

    'abaya_about_with_image', 'description' => __('This allows for an image and a simple about text.', 'abaya')); $this->__construct('abaya_about_with_image', __('Abaya: About With Image', 'abaya'), $widget_ops); $this->alt_option_name = 'abaya_about_with_image'; } public function widget($args, $instance){ extract( $args ); if(!empty($instance['more_about_me_link'])) {$more_about_me_link =''.__('MORE ABOUT ME','abaya').' ';} ?>

    flush_widget_cache(); return $instance; } function flush_widget_cache() { wp_cache_delete('abaya_about_with_image', 'widget'); } public function form($instance){ $image_uri = isset($instance['image_uri']) ? esc_attr($instance['image_uri']) : ''; $more_about_me_link = isset($instance['more_about_me_link']) ? esc_attr($instance['more_about_me_link']) : ''; ?>





    'abaya_front_page_product_widget', 'description' => esc_html__( 'This shows the most recent product on your site with a thumbnail', 'abaya') ); $control_ops = array( 'width' => 200, 'height' => 250 ); parent::__construct( false, $name = esc_html__('Abaya: Front Page Product With Images', 'abaya' ), $widget_ops, $control_ops); } function widget($args, $instance) { $cache = wp_cache_get('abaya_front_page_product_widget', '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']) ? __('Featured Product', 'abaya') : $instance['title'], $instance, $this->id_base); if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) $number = 5; $recent_posts = new WP_Query( apply_filters('widget_posts_args',array('post_type'=>'product','posts_per_page' => $number, 'product_cat' => $instance['thecate'], 'no_found_rows' => true, 'post_status' => 'publish','ignore_sticky_posts' => true ) ) ); if ($recent_posts->have_posts()) : ?> '; ?> have_posts()) : $recent_posts->the_post(); ?>
  • ID ) ) { $image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); $thumbnailURL = $image_url[0]; $image = aq_resize($thumbnailURL, 270, 319, true); if(empty($image)) { $image = $thumbnailURL; } } else { $thumbnailURL = wc_placeholder_img_src(); $image = aq_resize($thumbnailURL, 270, 319, true); if(empty($image)) { $image=$thumbnailURL; } } ?>
    <?php if ( get_the_title() ) the_title(); else the_ID(); ?>
    get_price_html(); ?>
    '.$after_widget; ?> 'product', 'child_of' => 0, 'parent' => '', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1, 'hierarchical' => 1, 'exclude' => '', 'number' => '', 'taxonomy' => 'product_cat', 'pad_counts' => false ); $categories=get_categories( $args ); $cate_options = array(); $cate_options[] = ''; foreach ($categories as $cate) { if ($thecate==$cate->slug) { $selected=' selected="selected"';} else { $selected=""; } $cate_options[] = ''; } ?>