如果没有给字段值,这总计应该隐藏

如果没有给字段值,这总计<tr>应该隐藏

问题描述:

我想改变wordpress模板中的表。如果没有给字段值,这总计<tr>应该隐藏

<tr> 
    <td><?php the_field('flipkart_price'); ?></td> 
</tr> 

如果没有给定值,以flipkart_price,这个总tr应该隐藏。 需要一个小型的PHP线路。

+1

您好,欢迎#1。请看看http://*.com/help/how-to-ask并编辑你的问题。我们在这里帮助您解决特定的编程问题,而不是为您编写代码。向我们展示您到目前为止所尝试的内容,与我们分享您的想法,社区将追上您的问题并帮助您找到解决方案。 – Twinfriends

下面的代码使用GET字段

<?php if(get_field('flipkart_price')): ?> 
    <tr><td><?php the_field('flipkart_price'); ?></td></tr> 
<?php endif; ?>