customized articles and categories, call does not display, search did not find, help to see where there is a problem, thank you
<?php
$args=array(
"hide_empty" => 0,
"exclude" => 0,
"taxonomy" => "cus_cat",
);
$cats=get_categories($args);
foreach ($cats as $cat){
$args = array(
"post_type" => "cus_post",
"tax_query" => array(
array(
"taxonomy" => "cus_cat",
"field" => "slug",
"terms" => $cat->slug,
),
)
);
$posts = new WP_Query( $args);
if(!empty($posts)){
echo "<li>".$the_cat->name."</li>"
foreach($posts as $post){
echo
"<li>
<a title="".wp_trim_words( get_the_excerpt(), 100 )."" href="".get_permalink($post->ID)."">".$post->post_title."</a>
</li>";
}
echo "<div class="clear"></div>";
}
};
?>