function st_location_list_activity_func($attr) { $data = shortcode_atts(array('st_location_style' => "", 'st_location_num' => "", 'st_location_orderby' => "", 'st_location_order' => ""), $attr, 'st_location_list_car'); extract($data); $return; $query = array('post_type' => 'st_activity', 'meta_key' => 'id_location', 'meta_value' => get_the_ID(), 'posts_per_page' => $st_location_num, 'order' => $st_location_order, 'orderby' => $st_location_orderby, 'post_status' => 'publish'); if (STInput::request('style')) { $st_location_style = STInput::request('style'); } if ($st_location_style == 'list') { $return .= "<ul class='booking-list loop-tours style_list loop-activity-location'>"; } else { $return .= '<div class="row row-wrap grid-activity-location">'; } query_posts($query); while (have_posts()) { the_post(); if ($st_location_style == 'list') { $return .= st()->load_template('activity/elements/loop/loop-1', null, array('is_location' => true)); } else { $return .= st()->load_template('activity/elements/loop/loop-2', null, array('is_location' => true)); } } wp_reset_query(); if ($st_location_style == 'list') { $return .= "</ul>"; } else { $return .= '</div>'; } $link = STLocation::get_total_text_footer('st_activity'); $return .= balancetags($link); return $return; }