Do not display if field is empty
-
( sorry for posting here, but my registration email is yet to be received )
I use his code to display a file download button.
However, I would like to hide the button if there is now file uploaded by admin.add_action( 'woocommerce_single_product_summary', 'wc_download_limited_offer_detail', 31 ); function wc_download_limited_offer_detail() { if ( has_term( 'offers', 'product_cat' ) ) { echo "<div id='dlbtn'><span class='dlbtn'><a target='_blank' href="; echo the_field('download_limited_offer_detail'); echo ">DOWNLOAD LIMITED OFFER DETAIL</a></span></div>"; } }Thank you
https://wordpress.org/plugins/advanced-custom-fields/
The topic ‘Do not display if field is empty’ is closed to new replies.