} } return $return; } /** * @package wordpress * @subpackage traveler * @since 1.1.3 * @descript get random post type to show widget */ public static function get_random_post_type($location_id, $post_type) { if (!$location_id) { $location_id = get_the_ID(); } if (!$post_type) { $post_type = "st_cars"; } $query = array('posts_per_page' => 1, 'post_type' => $post_type, 'orderby' => 'rand', 'post_status' => 'publish'); query_posts($query); while (have_posts()) { the_post(); $id = get_the_ID(); } wp_reset_query(); return $id; } } $a = new STLocation(); $a->init(); }