出于某种原因,在这个For each循环中,将每2个div包装成一行有点噩梦。。。。
有人能解释一下吗?
<?php
$terms = get_terms("aircraft_category"); // get all categories
$count = count($terms); //Count how many terms we have
if ( $count > 0 ){ //If there are more than 0 terms
foreach ( $terms as $term ) { //for each term:
echo "<div class=\'col-md-6 category\'>";
echo "<h3>";
echo $term->name;
echo "</h3>";
echo $term->description;
echo "<div class=\'link\'>";
echo "<a href=".get_term_link($term).">" . \'See More\' . "</a>";
echo "</div>";
echo " </div>\\n";
//create a list item with the current term slug for sorting, and name for label
}
}
?>
我尝试添加计数器,但没有成功。。。任何帮助都会很好。
提前谢谢。