/** * */ function widget($args, $instance) { global $wpdb, $shortname, $irish_framework_params; $prefix = MISS_PREFIX; extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', 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_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 .= miss_get_post_image( $filter_args ); $get_year = get_the_time( 'Y', get_the_ID() ); $get_month = get_the_time( 'm', get_the_ID() ); else { $out .= '<div class="month pull-left">'; $out .= '<span class="day">'; $out .= get_the_date('d'); $out .= '</span>'; $out .= get_the_date('M'); $out .= '</div>'; } */ 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' => 'image', 'preload' => false, 'placeholder' => true, 'echo' => false, 'wp_resize' => miss_get_setting('image_resize_type') == 'wordpress' ? true : false)); } $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', 60), apply_filters('miss_excerpt', THEME_ELLIPSIS)); $out .= '</div>'; $out .= '<div class="clearboth"></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']) ? __('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 $wpdb, $shortname, $irish_framework_params; $prefix = MISS_PREFIX; extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $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 = isset($instance['show_rating']) ? '1' : '0'; $recent_query = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_type' => 'testimonials', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1)); if ($recent_query->have_posts()) { $out .= '<div class="contents"> <div class="wrap">'; while ($recent_query->have_posts()) { $recent_query->the_post(); $out .= '<div class="module-replies"> <div class="quote"> “ </div> <div class="reply">'; $out .= get_the_content(); $out .= '</div> <i class="im-icon-user " style=""></i> <div class="name">'; $out .= get_the_title(); $out .= '</div> </div>'; } $out .= '</div> </div>'; } $out .= $after_widget; wp_reset_postdata(); echo $out; }
/** * */ function miss_query_posts() { global $wp_query, $irish_framework_params; $post_obj = $wp_query->get_queried_object(); $exclude_categories = miss_exclude_category_string(); $blog_layout = $irish_framework_params->layout['blog']['blog_layout']; $irish_framework_params->offset = $blog_layout == 'blog_layout2' || $blog_layout == 'blog_layout3' ? $irish_framework_params->layout['blog']['featured'] : false; if ($irish_framework_params->offset) { $irish_framework_params->offset = "1"; } // $blog_page = miss_blog_page(); // if( $blog_page == $post_obj->ID ) { // $irish_framework_params->is_blog = true; // } /* Reset offset for categories and search results */ if (is_archive() || is_search()) { $irish_framework_params->offset = "0"; } $paged = miss_get_page_query(); if (!empty($exclude_categories)) { $query_string = "cat={$exclude_categories}&paged={$paged}"; } else { $query_string = "paged={$paged}"; } if (is_home() || is_front_page()) { $query_string = $query_string . "&offset={$irish_framework_params->offset}"; } else { if (!empty($irish_framework_params->offset)) { if ($paged > 1) { $irish_framework_params->offset = 1; //$irish_framework_params->offset = (get_settings('posts_per_page')*$paged)/2+1; } else { $irish_framework_params->offset = 1; } $query_string = $query_string . "&offset={$irish_framework_params->offset}"; } else { $irish_framework_params->offset = "0"; $query_string = $query_string . "&offset={$irish_framework_params->offset}"; } } //print $query_string; if (isset($irish_framework_params->is_blog)) { return query_posts($query_string); } if (is_archive() || is_search()) { $irish_framework_params->archive_search = true; $irish_framework_params->offset = "0"; $args = array_merge($wp_query->query, array('post_type' => get_post_type(), 'category__not_in' => miss_exclude_category_array($minus = false), 'offset' => $irish_framework_params->offset)); return query_posts($args); } elseif (!empty($post_obj->ID)) { $blog_page = miss_blog_page(); if ($blog_page == $post_obj->ID) { $irish_framework_params->is_blog = true; $irish_framework_params->blog_page = $post_obj->ID; if (!empty($irish_framework_params->offset)) { $irish_framework_params->posts_per_page = get_option('posts_per_page'); add_filter('post_limits', 'my_post_limit'); } return query_posts($query_string); } } elseif (is_front_page() && miss_get_setting('frontpage_blog') || !empty($post_obj->ID) && get_option('page_for_posts') == $post_obj->ID) { if (!empty($irish_framework_params->offset)) { $irish_framework_params->posts_per_page = get_option('posts_per_page'); add_filter('post_limits', 'my_post_limit'); } $args = array_merge($wp_query->query, array('post_type' => 'post', 'paged' => $paged, 'offset' => $irish_framework_params->offset, 'category__not_in' => miss_exclude_category_array($minus = false))); return query_posts($args); } return false; }
/** * */ function miss_exclude_category_feed() { $exclude_categories = miss_exclude_category_string(); if (!empty($exclude_categories)) { if (is_feed()) { set_query_var('cat', $exclude_categories); } } }
/** * */ function widget($args, $instance) { global $wpdb, $irish_framework_params; $prefix = MISS_PREFIX; extract($args); $out = ''; if (!($popular_number = (int) $instance['popular_number'])) { $popular_number = 3; } else { if ($popular_number < 1) { $popular_number = 1; } else { if ($popular_number > 15) { $popular_number = 15; } } } if (!($recent_number = (int) $instance['recent_number'])) { $recent_number = 3; } else { if ($recent_number < 1) { $recent_number = 1; } else { if ($recent_number > 15) { $recent_number = 15; } } } if (!($comments_number = (int) $instance['comments_number'])) { $comments_number = 3; } else { if ($comments_number < 1) { $comments_number = 1; } else { if ($comments_number > 15) { $comments_number = 15; } } } $datastore = array('top' => array('title' => __('Popular', MISS_TEXTDOMAIN), 'data' => array()), 'new' => array('title' => __('Recent', MISS_TEXTDOMAIN), 'data' => array()), 'all' => array('icon' => 'fa-icon-comment', 'data' => array())); echo $before_widget; $count = !empty($count) ? trim($count) : '3'; $disable_thumb = $instance['disable_thumb'] ? '1' : '0'; $popular_query = new WP_Query(array('showposts' => $popular_number, 'nopaging' => 0, 'orderby' => 'comment_count', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1)); $i = 0; while ($popular_query->have_posts()) { $popular_query->the_post(); $i++; if (!$disable_thumb) { $widget_thumb_img = $irish_framework_params->layout['big_sidebar_images']['small_post_list']; $datastore['top']['data'][$i]['image'] = 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)); } else { $widget_thumb_img = array('', ''); } $datastore['top']['data'][$i]['url'] = esc_url(get_permalink()); $datastore['top']['data'][$i]['title'] = get_the_title(); $datastore['top']['data'][$i]['content'] = miss_excerpt(get_the_excerpt(), 40, THEME_ELLIPSIS); } $recent_query = new WP_Query(array('showposts' => $recent_number, 'nopaging' => 0, 'orderby' => 'post_date', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1)); $i = 0; while ($recent_query->have_posts()) { $recent_query->the_post(); $i++; if (!$disable_thumb) { $widget_thumb_img = $irish_framework_params->layout['big_sidebar_images']['small_post_list']; $datastore['new']['data'][$i]['image'] = 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)); } else { $widget_thumb_img = array('', ''); } $datastore['new']['data'][$i]['url'] = esc_url(get_permalink()); $datastore['new']['data'][$i]['title'] = get_the_title(); $datastore['new']['data'][$i]['content'] = miss_excerpt(get_the_excerpt(), 40, THEME_ELLIPSIS); $datastore['new']['data'][$i]['d'] = get_the_date('d'); $datastore['new']['data'][$i]['M'] = get_the_date('M'); } $comments = get_comments(array('number' => $comments_number, 'status' => 'approve')); foreach ($comments as $comment) { $i++; $datastore['all']['data'][$i] = array('content' => $comment->comment_content, 'post_id' => $comment->comment_post_ID, 'url' => get_permalink($comment->comment_post_ID), 'title' => get_the_title($comment->comment_post_ID)); } $out .= '<div class="module-posts">'; $out .= '<div class="posts-heading"><ul class="posts-row">'; $i = 0; foreach ($datastore as $key => $items) { $class = $i == 0 ? ' active' : ''; // print_r($items); $out .= '<li class="posts-cell ' . $class . '">'; $out .= '<a href="#" data-block="' . $key . '-posts">'; $out .= isset($items['icon']) ? '<i class="' . $items['icon'] . '"></i> ' : ''; $out .= isset($items['title']) ? $items['title'] : ''; $out .= '</a>'; $out .= '</li>'; $i++; } $out .= '<div class="clearboth"></div>'; $out .= '</ul></div>'; $out .= '<div class="posts-content">'; foreach ($datastore as $key => $items) { $out .= '<div class="posts-block ' . $key . '-posts">'; foreach ($items['data'] as $id => $item) { if (isset($item['content']) && !empty($item['content'])) { $out .= '<div class="author">'; $out .= isset($item['image']) && !empty($item['image']) ? $item['image'] : ''; $out .= '<div class="desc">'; $out .= isset($item['title']) && !empty($item['title']) ? '<div class="name">' . $item['title'] . '</div>' : ''; $out .= '<div class="position">Position</div>'; $out .= '<div class="text">'; $out .= isset($item['content']) && !empty($item['content']) ? $item['content'] : ''; $out .= '</div>'; $out .= '</div>'; $out .= '</div>'; } } $out .= '<a href="/?post_type=post" class="read-all">Read all</a>'; $out .= '</div>'; } $out .= '</div><!-- /.hot_updates -->'; $out .= '</div><!-- /.module-posts -->'; echo $out; echo $after_widget; }
/** * */ 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(); }