/** * GET SUB CATS FROM A POST */ $args = array('child_of' => 7 , 'hide_empty' => 0); $categories = get_categories( $args ); foreach($categories as $category) { echo '
'; // Get POSTS from categor to grab the image. $args = array('category' => $category->ID); $posts = get_posts($args); foreach ($posts as $post){ var_dump($post); } echo '

name ) . '" ' . '>' . $category->name.'

'; echo '
'; } ?>