cat_ID; } else { $cat = get_queried_object_id(); } $cargs = array( 'posts_per_page' => $item_max, 'post_status' => 'publish', 'cat' => $cat ); } elseif( $item_types === 'tag_list' && ( $_is['single'] === true || $_is['tag'] === true ) ) { $tag_id = null; if( $_is['tag'] === false ) { $tags = get_tags(); if( empty( $tags ) ) return; $tag_id = $tags[0]->term_taxonomy_id; } else { $tag_id = get_queried_object_id(); } $cargs = array( 'posts_per_page' => $item_max, 'post_status' => 'publish', 'tag_id' => $tag_id ); } elseif( ( $item_types === 'cat_list' || $item_types === 'tag_list' ) && ( $_is['year'] === true || $_is['month'] === true || is_date() === true ) ) { $year = get_query_var('year'); $month = get_query_var('monthnum'); $day = get_query_var('day'); if( $_is['year'] === true ) { $cargs = array( 'posts_per_archive_page' => $item_max, 'post_status' => 'publish', 'date_query' => array( 'year' => $year ) ); } elseif( $_is['month'] === true ) { $cargs = array( 'posts_per_archive_page' => $item_max, 'post_status' => 'publish', 'date_query' => array( 'year' => $year, 'month' => $month ) ); } else { $cargs = array( 'posts_per_archive_page' => $item_max, 'post_status' => 'publish', 'date_query' => array( 'year' => $year, 'month' => $month, 'day' => $day ) ); } } elseif( $item_types === 'page_list' ) { $cargs = array( 'posts_per_page' => $item_max, 'post_status' => 'publish', 'post_type' => 'page' ); } elseif( $item_types === 'specified' && !empty( $ids ) ) { $specifieds = null; if( $item_types === 'specified' && !empty( $ids ) ) { $specifieds = array(); $post_not_in = array(); $arr = explode( ',', $ids ); foreach( (array)$arr as $value ) { $specifieds = array_merge( $specifieds, explode( "\n", $value ) ); } $sticky_posts = get_option( 'sticky_posts' ); foreach( (array)$sticky_posts as $value ) { if( in_array( $value, $specifieds ) === false ) { $post_not_in[] = $value; } } if( count( $specifieds ) < $item_max ) { $item_max = count( $specifieds ); } $cargs = array( 'posts_per_page' => $item_max, 'post_status' => 'publish', 'post__in' => $specifieds, 'post__not_in' => $post_not_in, 'post_type' => 'any' ); } } elseif( $item_types === 'all_list' || $_is['home'] === true || $_is['front_page'] === true ) { $found_posts = wp_count_posts( 'post' ); if( (int)$found_posts->publish < $item_max ) $item_max = (int)$found_posts->publish; $cargs = array( 'posts_per_page' => $item_max, 'post_status' => 'publish', 'post_type' => 'post' ); } else { return; } $cquery = new WP_Query( $cargs ); if( $cquery->found_posts < $item_max ) $item_max = $cquery->found_posts; if( $show_max > $item_max ) $show_max = $item_max - 1; if( $show_max <= 0 ) $show_max = 1; echo "\n"; echo $args['before_widget']; if( !empty( $title ) ) echo $args['before_title'], $title, $args['after_title']; $max_height = ''; if( $height !== 'auto' ) { $max_height = $heightpx . 'px'; } else { $max_height = $thumb === 'thumbnail' ? '150px' : '300px'; } ?>
\n"; } endif;