我有一个主题,它创建了两列类别,其中包含来自该类别的子帖子。我尝试过在列出两篇帖子后插入的代码,但它不起作用(因为我不知道自己在做什么)。当前php呈现如下:
<div class="row">
<div class="column col-half">...</div>
<div class="column col-half">...</div>
</div>
我希望它呈现为:<div class="row">
<div class="column col-third">...</div>
<div class="column col-third">...</div>
<div class="column col-third">...</div>
</div>
以下是呈现HTML的主题代码:$st_categories = get_categories($st_hp_cat_args);
$st_categories = wp_list_filter($st_categories,array(\'parent\'=>0));
if ($st_categories) {
foreach($st_categories as $st_category) {
$st_cat_counter++;
if ((!is_int($st_cat_counter / 2)) && $st_cat_counter != 1) {
echo \'</div><div class="row">\';} elseif ($st_cat_counter == 1)
{ echo \'<div class="row">\';}
echo \'<div class="column col-half \'. $st_cat_counter.\'">\';
echo \'<h3> <a href="\' . get_category_link( $st_category->term_id ) . \'" title="\' . sprintf( __( \'View all posts in %s\', \'framework\' ), $st_category->name ) . \'" \' . \'>\' . $st_category->name.\'</a>\';
if (of_get_option(\'st_hp_cat_counts\') == \'1\') {
echo \'<span class="cat-count">(\' . $st_category->count.\')</span>\';
}
echo \'</h3>\';
提前谢谢。