我想根据字段是否具有'copyclearance'的值来过滤内容。它正在过滤,而不是显示具有'copyclearance'值的内容,而是隐藏它并显示其他内容。我如何替换它,以便它只显示值为'copyclearance'的内容。Php过滤内容错误
<?php while(has_sub_field('team_profile')):
$category = get_sub_field('category');
if($category!='copyclearance'){ ?>
<li class="col-lg-3 teamProfile">
<img src="<?php the_sub_field('user_image'); ?>" class="img-responsive"/>
<h2><?php the_sub_field('profile_name'); ?></h2>
<p class="jobTitle"><?php the_sub_field('category'); ?></p>
<p><?php the_sub_field('bio'); ?></p>
</li>
<?php }
endwhile; ?>
如果改变($类!= 'copyclearance')到如果($类== 'copyclearance') – Steve
如果逻辑错误的执行,总是PHP的错:P – DanFromGermany