wordpress自定义字段为空不显示

2021年 1月 17日 1635点热度 0人点赞 0条评论

 

 

<?php  $tel1 = get_post_meta($post->ID, 'tel1', true);
if (!empty ( $tel1 )) {
<li ><?php the_field('tel1'); ?></li>
<?php } ?>

xinfa

这个人很懒,什么都没留下