我有以下代码:
if( get_field('event_timedate') ): echo "<div class='bm-event_timedate'><p>".the_field('event_timedate')."</p></div>"; endif;
但由于某种原因,输出是(日期出现在 div 和 p 标签之前)
27/08/2022 8:00pm <div class='bm-event_timedate'><p>".the_field('event_timedate')."</p></div>
非常感谢您的帮助,提前致谢!
最佳答案
也使用 get_field()
函数进行 echo
if( get_field('event_timedate') ):
echo "<div class='bm-event_timedate'><p>".get_field('event_timedate')."</p></div>";
endif;
关于PHP echo字段,字段出现在div之前,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74063297/