parent ) {
echo ‘

  • ‘ . $cat->name . ‘
  • ‘;
    process_cat_tree( $cat->term_id );
    }
    endforeach;

    wp_reset_query(); //to reset all trouble done to the original query
    //
    function process_cat_tree( $cat ) {

    $args = array(‘category__in’ => array( $cat ), ‘numberposts’ => 3);
    $cat_posts = get_posts( $args );

    if( $cat_posts ) :
    foreach( $cat_posts as $post ) :
    echo ‘

  • ‘;
    echo ‘
    $500*
    $501*
    $250*
    -->