Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何隐藏空元素?_Php_Wordpress - Fatal编程技术网

Php 如何隐藏空元素?

Php 如何隐藏空元素?,php,wordpress,Php,Wordpress,我在WordPress中有下面的代码。如果没有内容,如何使“细节”一词在前端消失 $detail = get_term_meta( $tagid, 'detail', true ); <div class="mt15 fontbold font120">Details: </div> <div class="detail-div"> <?php echo do_shortcode($detail);?

我在WordPress中有下面的代码。如果没有内容,如何使“细节”一词在前端消失

 $detail = get_term_meta( $tagid, 'detail', true );
     <div class="mt15 fontbold font120">Details:
     </div>
     <div class="detail-div">
           <?php echo do_shortcode($detail);?>
     </div>
$detail=get\u term\u meta($tagid,'detail',true);
细节:

测试详细信息是否为空。如果是,则输出一个空字符串,否则为“详细信息”:

$detail=get\u term\u meta($tagid,'detail',true);