Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1130349
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this question<?php if( get_field('packaging_details','port','lead_time') ): ?>
<div class="prd-overview-list">
<h3>Packaging & Delivery</h3>
<ul>
<?php if( get_field('packaging_details') ): ?><li><p>Packaging Details</p> <p><span><?php the_field( 'packaging_details' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('port') ): ?><li><p>Port</p> <p><span><?php the_field( 'port' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('lead_time') ): ?><li><p>Lead Time</p> <p><span><?php the_field( 'lead_time' ); ?></span></p></li><?php endif; ?>
</ul>
</div><?php endif; ?>
i want if all 3 fields are empty, hide full div. and when any field have value, show full div
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this question<?php if( get_field('packaging_details','port','lead_time') ): ?>
<div class="prd-overview-list">
<h3>Packaging & Delivery</h3>
<ul>
<?php if( get_field('packaging_details') ): ?><li><p>Packaging Details</p> <p><span><?php the_field( 'packaging_details' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('port') ): ?><li><p>Port</p> <p><span><?php the_field( 'port' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('lead_time') ): ?><li><p>Lead Time</p> <p><span><?php the_field( 'lead_time' ); ?></span></p></li><?php endif; ?>
</ul>
</div><?php endif; ?>
i want if all 3 fields are empty, hide full div. and when any field have value, show full div
Share Improve this question asked Dec 13, 2018 at 11:42 Karan KcoresysKaran Kcoresys 135 bronze badges1 Answer
Reset to default 0Please try below and let me know if any query.
<?php if( get_field('packaging_details') || get_field('port') || get_field('lead_time')): ?>
<div class="prd-overview-list">
<h3>Packaging & Delivery</h3>
<ul>
<?php if( get_field('packaging_details') ): ?><li><p>Packaging Details</p> <p><span><?php the_field( 'packaging_details' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('port') ): ?><li><p>Port</p> <p><span><?php the_field( 'port' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('lead_time') ): ?><li><p>Lead Time</p> <p><span><?php the_field( 'lead_time' ); ?></span></p></li><?php endif; ?>
</ul>
</div><?php endif; ?>
Hope it will help you !
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this question<?php if( get_field('packaging_details','port','lead_time') ): ?>
<div class="prd-overview-list">
<h3>Packaging & Delivery</h3>
<ul>
<?php if( get_field('packaging_details') ): ?><li><p>Packaging Details</p> <p><span><?php the_field( 'packaging_details' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('port') ): ?><li><p>Port</p> <p><span><?php the_field( 'port' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('lead_time') ): ?><li><p>Lead Time</p> <p><span><?php the_field( 'lead_time' ); ?></span></p></li><?php endif; ?>
</ul>
</div><?php endif; ?>
i want if all 3 fields are empty, hide full div. and when any field have value, show full div
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this question<?php if( get_field('packaging_details','port','lead_time') ): ?>
<div class="prd-overview-list">
<h3>Packaging & Delivery</h3>
<ul>
<?php if( get_field('packaging_details') ): ?><li><p>Packaging Details</p> <p><span><?php the_field( 'packaging_details' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('port') ): ?><li><p>Port</p> <p><span><?php the_field( 'port' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('lead_time') ): ?><li><p>Lead Time</p> <p><span><?php the_field( 'lead_time' ); ?></span></p></li><?php endif; ?>
</ul>
</div><?php endif; ?>
i want if all 3 fields are empty, hide full div. and when any field have value, show full div
Share Improve this question asked Dec 13, 2018 at 11:42 Karan KcoresysKaran Kcoresys 135 bronze badges1 Answer
Reset to default 0Please try below and let me know if any query.
<?php if( get_field('packaging_details') || get_field('port') || get_field('lead_time')): ?>
<div class="prd-overview-list">
<h3>Packaging & Delivery</h3>
<ul>
<?php if( get_field('packaging_details') ): ?><li><p>Packaging Details</p> <p><span><?php the_field( 'packaging_details' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('port') ): ?><li><p>Port</p> <p><span><?php the_field( 'port' ); ?></span></p></li><?php endif; ?>
<?php if( get_field('lead_time') ): ?><li><p>Lead Time</p> <p><span><?php the_field( 'lead_time' ); ?></span></p></li><?php endif; ?>
</ul>
</div><?php endif; ?>
Hope it will help you !
本文标签: advanced custom fields if field has value show main div
版权声明:本文标题:advanced custom fields if field has value show main div 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749103270a2316334.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论