Check if acf field exist in functions.php

Today i am working in a project. My client requirement was if content exists then only the field visible on single product page. and he wanted to add a product video on the single product page.
also on the field my client also want to popup a video. so first i was installed Easy FancyBox

Then i found a some code on the Easy FancyBox by which i can popup a video easily

Next step i need to play with it. I have Created a video field on the ACF. ACF field name is  product_video

The field only visible on product page

Next is the Big part is to display the product video on single product page. i need to use some div  for popup the product video and all i need to do in functions.php its my big challenge. then i found a solution from ACF support page.

Only this code check entire content if exist it will display the popup button.

The front end view:

when click on the Product Video it will popup a video

If you find this post useful comment out.


Leave a Comment

Your email address will not be published. Required fields are marked *