这段代码有什么问题?
计数工作正常,但如果这个代码是错误的,有人能帮助我吗?
感谢<div <?php if (($count%3)==0) {post_class("$term_list one-third column ultimo")}
else {post_class("$term_list one-third column")} ?> >
尝试以下方法,并确保您的$count
和$term_list
两个变量在当前作用域中可用:
<?php if ( ($count % 3) == 0 ): $classes = array($term_list, 'one-third', 'column ultimo'); ?>
<div <?php post_class($classes); ?>>
<?php else: ?>
<div>
<?php endif;?>