true, 'column' => 'post_date', ); if ($date_from_valid !== '') { $range['after'] = $date_from_valid; } if ($date_to_valid !== '') { $range['before'] = $date_to_valid; } $date_query[] = $range; } if ($tag_slug !== '') { $resolved_tag = get_term_by('slug', $tag_slug, 'post_tag'); if (!($resolved_tag instanceof WP_Term)) { $tag_slug = ''; } } $available_tags = get_terms(array( 'taxonomy' => 'post_tag', 'hide_empty' => true, 'orderby' => 'name', 'order' => 'ASC', )); if (is_wp_error($available_tags)) { $available_tags = array(); } $list_query_args = array( 'post_type' => $active_post_type, 'post_status' => 'publish', 'posts_per_page' => 10, 'paged' => $paged, 'ignore_sticky_posts' => true, 'orderby' => 'date', 'order' => 'DESC', 'suppress_filters' => false, ); if ($keyword !== '') { $list_query_args['itstudio_archive_extend_search'] = true; $list_query_args['itstudio_archive_keyword'] = $keyword; } if (!empty($date_query)) { $list_query_args['date_query'] = $date_query; } if ($tag_slug !== '') { $list_query_args['tax_query'] = array( array( 'taxonomy' => 'post_tag', 'field' => 'slug', 'terms' => array($tag_slug), ), ); } $list_query = new WP_Query($list_query_args); $featured_query = new WP_Query(array( 'post_type' => $active_post_type, 'post_status' => 'publish', 'posts_per_page' => 4, 'ignore_sticky_posts' => true, 'meta_key' => $weight_meta_key, 'orderby' => array( 'meta_value_num' => 'DESC', 'date' => 'DESC', ), 'order' => 'DESC', 'no_found_rows' => true, )); $featured_ids = array_map('intval', wp_list_pluck($featured_query->posts, 'ID')); wp_reset_postdata(); if (count($featured_ids) < 4) { $fill_query = new WP_Query(array( 'post_type' => $active_post_type, 'post_status' => 'publish', 'posts_per_page' => 4 - count($featured_ids), 'ignore_sticky_posts' => true, 'post__not_in' => $featured_ids, 'orderby' => 'date', 'order' => 'DESC', 'no_found_rows' => true, )); $featured_ids = array_merge($featured_ids, array_map('intval', wp_list_pluck($fill_query->posts, 'ID'))); wp_reset_postdata(); } $featured_ids = array_slice(array_values(array_unique($featured_ids)), 0, 4); ?> 发布时间起 发布时间止 标签 全部标签 slug); ?>> name); ?> 筛选 搜索 have_posts()) : ?> have_posts()) : $list_query->the_post(); ?> Views / Published / Author / Words Tags #name); ?> No tags 'lazy')); ?> $pagination_base, 'format' => '', 'current' => $paged, 'total' => max(1, (int) $list_query->max_num_pages), 'mid_size' => 2, 'prev_text' => 'Previous', 'next_text' => 'Next', 'add_args' => array_filter( array( 'q' => $keyword, 'date_from' => $date_from, 'date_to' => $date_to, 'tag' => $tag_slug, ), static function ($value) { return $value !== ''; } ), )) ); ?> ', ''); the_archive_description('', ''); ?> > | -> 2, 'prev_text' => __('Previous', 'itstudio'), 'next_text' => __('Next', 'itstudio'), )); ?>