'']; $the_query = new WP_Query($this->args); $i = 0; if ($the_query->have_posts()) { while ($the_query->have_posts()) : $the_query->the_post(); $i++; $rtn['content'] .= $this->get_nav_single($the_query); endwhile; } wp_reset_postdata(); $rtn['post_count'] = $i; $rtn['content'] = apply_filters('leapin_post_widget_return_content_json', $rtn['content']); return json_encode($rtn); } private function get_nav_single($the_query) { $id = get_the_ID(); $title = get_the_title(); $permalink = leapin_get_permalink(); $thumbnail_url = leapin_get_eyecatch_image('leapin-medium', $id)[0]; $call_position = $this->call_position; $level = ""; if (!$call_position) { return ""; } elseif ($call_position == "nav_level_0") { $level = "level-1"; } elseif ($call_position == "nav_level_1") { $level = "level-2"; } ob_start(); ?> is_first_loop($the_query)): ?>