<ul>
<?php $hiterms = get_terms("my_tax", array("orderby" => "slug", "parent" => 0)); ?>
<?php foreach($hiterms as $key => $hiterm) : ?>
<li>
<?php echo $hiterm->name; ?>
<?php $loterms = get_terms("my_tax", array("orderby" => "slug", "parent" => $hiterm->term_id)); ?>
<?php if($loterms) : ?>
<ul>
<?php foreach($loterms as $key => $loterm) : ?>
<li><?php echo $loterm->name; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php
$args = array(
'post_type' => 'projects',
'posts_per_page' => 9,
);
$projects_posts = get_posts( $args );
?>
<?php
foreach($projects_posts as $projectKey => $post) :
setup_postdata( $post );
?>
<div class="portfolio_card">
<img src="<?php echo the_post_thumbnail_url( 'full' ); ?>" alt="photo">
<div class="internal_slider">
<div class="internal_slide_text">
<div class="icons">
<?php echo carbon_get_post_meta( get_the_ID(), 'projects-item-slider-icons' ); ?>
</div>
<span class="card_header">
<?php echo carbon_get_post_meta( get_the_ID(), 'projects-item-slider-name' ); ?>
</span>
<p class="p">
<?php echo carbon_get_post_meta( get_the_ID(), 'projects-item-slider-desc' ); ?>
</p>
</div>
<a href="portfolio-card.html" class="about_internal_slider_pagination internal_pagination"></a>
<div class="swiper about_internal_slider_name">
<div class="swiper-wrapper">
<?php
$projectsInternalData = carbon_get_post_meta( get_the_ID(), 'projects-item-slider' );
if (!empty($projectsInternalData)) :
foreach($projectsInternalData as $projectsInternal => $projectsInternalItem) :
?>
<div class="swiper-slide">
<img src="<?php echo esc_html( $projectsInternalItem['projects-item-slider-image'] ) ?>" alt="image">
<div class="overlay"></div>
</div>
<?php
endforeach;
endif;
?>
</div>
</div>
</div>
</div>
<?php
endforeach;
?>