<?php
get_header();


?>
<div class="container">
    <div class="archive-wrapper">
    <h2 class="section-title text-center">Custom Fabrication</h2>
    <?php
        $post_type = 'custom-fabrication';  

        
        $args = [
            'taxonomy'   => 'custom-fabric-cat', 
            'parent'     => 0,          
            'hide_empty' => false,     
        ];

        $categories = get_terms($args);
        //var_dump($categories);
        echo '<div class="posts-list">';
        if (!empty($categories) && !is_wp_error($categories)) {
            echo '<div class="items-list">';
            foreach ($categories as $category) {
               // echo '<li>' . esc_html($category->name) . '</li>';
                tdg_render_post_and_term_items('term', $category->taxonomy, $category->term_id);
            }
            echo '</div>';
        } else {
            echo 'No post';
        }
        echo '</div>';

    ?>
    </div>
</div>

<?php
get_footer();