?> <?php } else { if ($parent->slug == 'online-magazine' || $category[0]->slug == 'khuyen-mai-trong-tuan') { while (have_posts()) { the_post(); $listGalery = getGaleryFromPost($post); if ($listGalery[0]) { ?> <?php if (wpmd_is_notdevice() == true) { ?> <!-- is tablet and desktop --> <!doctype html> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <!-- viewport --> <meta content="width=device-width,initial-scale=1" name="viewport">
public function get_search_results() { global $json_api; // if ($json_api->query->search) { $posts = $json_api->introspector->get_posts(array('s' => $json_api->query->search, 'cat' => $json_api->query->category_id), true); $uploads = wp_upload_dir(); $upload_path = $uploads['baseurl']; if (!empty($posts)) { foreach ($posts as &$post) { $galleries = getGaleryFromPost($post); $img_list = array(); $i = 0; $ids = $galleries[0]['ids']; foreach ($ids as $id) { $img = wp_get_attachment_metadata($id); $img_list[$i++] = $upload_path . '/' . $img['file']; } $post->galleries = empty($img_list) ? array() : $img_list; } } // } else { // $json_api->error("Include 'search' var in your request."); // } return $this->posts_result($posts); }