<?php 

/**

* Template Name: Check Categories

* 

* @package WP_Corporate

*/


$args = array(
      'orderby' => 'id',
      'hide_empty'=> 0 
  );
  $categories = get_categories($args);
  foreach ($categories as $cat) {
        echo '<div style="width:20%;float:left;">';
        echo '<h1 class="valignmiddle uppercase title-bold">'.$cat->name.'('.$cat->cat_ID.')'.'<img src="'.$cat->term_icon.'" alt=""  class="alignleft"/>'.'<br />'.'<span class="solutions">'.$cat->description.'</span>'.'</h1>';
        //echo '<br />';
        $args2= array("orderby"=>'name', "category" => $cat->cat_ID); // Get Post from each Sub-Category
        $posts_in_category = get_posts($args2);
        foreach($posts_in_category as $current_post) {
            echo '<span>';
            ?>
            <li type='none' style='list-style-type: none !important;'><a href="<?=$current_post->guid;?>"><?='+ '.$current_post->post_title;?></a></li>
            <?php
            echo '</span>';
        }
        echo '</div>';
    }