Самое читаемое
id;},$top)); if(has_tag(103565, get_queried_object_id())){ $featured = $wpdb->get_results("select id from wp_posts where id not in (".$notin.") and 2=2 and post_type in ('anew', 'yellow') and id != ".get_queried_object_id()." and post_status = 'publish' and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_hide_on_website' AND meta_value = '1' ) and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_only_link_access' AND meta_value = '1' ) and id in (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 103565 ) order by post_date desc limit 11", OBJECT); }else{ $featured = $wpdb->get_results("select id from wp_posts where id not in (".$notin.") and 3=3 and post_type in ('anew', 'yellow') and id != ".get_queried_object_id()." and post_status = 'publish' and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_hide_on_website' AND meta_value = '1' ) and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_only_link_access' AND meta_value = '1' ) and id not in (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 103565 ) and id in (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = ".get_post_primary_category_id(get_queried_object_id()).") order by post_date desc limit 11", OBJECT); } $items = array_merge($top, $featured); $has_with_tag = false; foreach ($items as $item): if(has_tag(7840, $item->id)){ if($has_with_tag === true){ continue; } $has_with_tag = true; } $post = get_post($item->id); if ($item->id == $current){ continue; } ?>