$port_cat, 'post_per_page' => -1, 'post_status' => 'publish' ); $port_query = new WP_Query($args); $all_cat = get_categories(array('type' => 'post', 'parent' => $port_cat)); if($port_query->have_posts()){ ?>
have_posts()): while ($port_query->have_posts()) : $port_query->the_post(); $term_lists = wp_get_post_terms($post->ID, 'category', array("fields" => "all")); $term_slugs = array(); foreach ($term_lists as $term_list) { $term_slugs[] = $term_list->slug; } $term_slugs = join(' ', $term_slugs); ?>