Search code examples
wordpresscustom-post-type

How to add a dynamic select field in woocommerce product page


I have a custom post type fine_prints with only a title field.

I want to add a new field in woocommerce product page. A dynamic select that will show all fine_prints with their id as value. I have added many custom fields in product page using ACF. I'm new to wordpress. How can I achieve this? Any help? I want to do this in functions.php. Thankyou.


Solution

  • For adding select custom filed for custom post type in AC, follow

    1. Select Filed type "Post Object"
    2. Select "Post type"

    It will return an array so you can loop through it.

    enter image description here