gpt4 book ai didi

php - 当 the_field 为空时隐藏一个 div

转载 作者:太空宇宙 更新时间:2023-11-04 02:02:14 25 4
gpt4 key购买 nike

<div class="full-width awards">
<h2><span>Awards</span></h2>
<div id="accordion" class="accordion awards-list">

<?php if (get_field( 'awards_&_festivals' ) ) : ?>

<h3 class="award-title" ><span class="down-icon">Awards &amp; Festivals</span></h3>
<div class="award-content" >
<?php the_field( 'awards_&_festivals' ); ?>
</div>

<?php endif; ?>

</div>

我想在 the_field 没有任何内容时隐藏 awards div 关于如何实现这一点的想法?非常感谢。

最佳答案

We can do it like this -

if ($(".award-content").html() == "") {
$('.awards').hide();
}

关于php - 当 the_field 为空时隐藏一个 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41560846/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com