/** * */ function widget($args, $instance) { global $wpdb, $shortname, $irish_framework_params; $prefix = MISS_PREFIX; extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent News', MISS_TEXTDOMAIN) : $instance['title'], $instance, $this->id_base); $tagline = apply_filters('widget_tagline', empty($instance['tagline']) ? '' : '<h6>' . $instance['tagline'] . '</h6>', $instance, $this->id_base); if (!($number = (int) $instance['number'])) { $number = 3; } else { if ($number < 1) { $number = 1; } else { if ($number > 15) { $number = 15; } } } $out = $before_widget; $out .= $before_title . $title . $after_title . $tagline; $disable_thumb = $instance['disable_thumb'] ? '1' : '0'; $show_rating = isset($instance['show_rating']) ? '1' : '0'; $recent_query = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_type' => 'vacancy', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1)); if ($recent_query->have_posts()) { $out .= '<ul class="post_list small_post_list">'; while ($recent_query->have_posts()) { $recent_query->the_post(); $out .= '<li class="post_list_module">'; $out .= '<div class="month pull-left">'; $out .= '<span class="day">'; $out .= get_the_date('d'); $out .= '</span>'; $out .= get_the_date('M'); $out .= '</div>'; $out .= '<p class="post_title">'; $out .= '<a rel="bookmark" href="' . esc_url(get_permalink()) . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a>'; $out .= '</p>'; $out .= '<div class="post_excerpt">'; $out .= miss_excerpt(get_the_excerpt(), apply_filters('miss_home_spotlight_excerpt', 55), apply_filters('miss_excerpt', THEME_ELLIPSIS)); $out .= '</div>'; if ($show_rating && score_value(get_the_ID()) != 0) { $postid = get_the_ID(); $score = score_value($postid); $out .= '<div class="rating_box">' . score_output($score, 'small') . '</div>'; } $out .= '</li>'; } $out .= '</ul>'; } $out .= $after_widget; wp_reset_postdata(); echo $out; }
/** * */ function widget($args, $instance) { global $wpdb, $shortname, $irish_framework_params; $prefix = MISS_PREFIX; extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Top Rated', MISS_TEXTDOMAIN) : $instance['title'], $instance, $this->id_base); if (!($number = (int) $instance['number'])) { $number = 3; } else { if ($number < 1) { $number = 1; } else { if ($number > 15) { $number = 15; } } } $out = $before_widget; $out .= $before_title . $title . $after_title; $disable_thumb = $instance['disable_thumb'] ? '1' : '0'; $show_rating = $instance['show_rating'] ? '1' : '0'; $top_query = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'meta_key' => '_review_0', 'orderby' => 'meta_value', 'order' => 'DESC', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1)); if ($top_query->have_posts()) { $out .= '<ul class="post_list small_post_list">'; while ($top_query->have_posts()) { $top_query->the_post(); $out .= '<li class="post_list_module">'; if (!$disable_thumb) { $widget_thumb_img = $irish_framework_params->layout['big_sidebar_images']['small_post_list']; $out .= miss_get_post_image(array('width' => $widget_thumb_img[0], 'height' => $widget_thumb_img[1], 'img_class' => 'post_list_image', 'preload' => false, 'placeholder' => true, 'echo' => false, 'wp_resize' => miss_get_setting('image_resize_type') == 'wordpress' ? true : false)); } $out .= '<div class="post_list_content">'; $out .= '<p class="post_title">'; $out .= '<a rel="bookmark" href="' . esc_url(get_permalink()) . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a>'; $out .= '</p>'; $get_year = get_the_time('Y', get_the_ID()); $get_month = get_the_time('m', get_the_ID()); if ($show_rating && score_value(get_the_ID()) != 0) { $postid = get_the_ID(); $score = score_value($postid); $out .= '<div class="rating_box">' . score_output($score, 'small') . '</div>'; } $out .= '</div>'; $out .= '</li>'; } $out .= '</ul>'; } $out .= $after_widget; wp_reset_postdata(); echo $out; }
/** * */ function widget($args, $instance) { global $irish_framework_params; $prefix = MISS_PREFIX; extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Popular Posts', MISS_TEXTDOMAIN) : $instance['title'], $instance, $this->id_base); if (!($number = (int) $instance['number'])) { $number = 3; } else { if ($number < 1) { $number = 1; } else { if ($number > 15) { $number = 15; } } } echo $before_widget; echo $before_title . $title . $after_title; $count = !empty($count) ? trim($count) : '3'; $disable_thumb = $instance['disable_thumb'] ? '1' : '0'; $show_rating = !empty($instance['show_rating']) ? '1' : '0'; $show_date = !empty($instance['show_date']) ? '1' : '0'; $popular_query = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'orderby' => 'comment_count', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1)); $out = '<ul class="post_list small_post_list">'; while ($popular_query->have_posts()) { $popular_query->the_post(); $out .= '<li class="post_list_module">'; if (!$disable_thumb) { $widget_thumb_img = $irish_framework_params->layout['small_sidebar_images']['small_post_list']; $out .= miss_get_post_image(array('width' => $widget_thumb_img[0], 'height' => $widget_thumb_img[1], 'img_class' => 'image', 'preload' => false, 'placeholder' => true, 'echo' => false, 'wp_resize' => miss_get_setting('image_resize_type') == 'wordpress' ? true : false)); } $out .= '<div class="post_list_content">'; if ($show_rating && score_value(get_the_ID()) != 0) { $postid = get_the_ID(); $score = score_value($postid); $out .= '<div class="rating_box">' . score_output($score, 'small') . '</div>'; } $out .= '<p class="post_title">'; $out .= '<a rel="bookmark" href="' . esc_url(get_permalink()) . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a>'; $out .= '</p>'; $out .= '<div class="post_excerpt">'; $out .= miss_excerpt(get_the_excerpt(), apply_filters('miss_home_spotlight_excerpt', 55), apply_filters('miss_excerpt', THEME_ELLIPSIS)); $out .= '</div>'; $out .= '<div class="clearboth"></div>'; /* $get_year = get_the_time( 'Y', get_the_ID() ); $get_month = get_the_time( 'm', get_the_ID() ); */ if ($show_date) { $out .= '<p class="post_meta">'; $out .= apply_filters('miss_widget_meta', do_shortcode('[post_date]')); $out .= '</p>'; } $out .= '</div>'; $out .= '</li>'; } $out .= '</ul>'; echo $out; echo $after_widget; wp_reset_postdata(); }