I have a custom php file in wordpress child-theme, where i need to retrieve a custom field from a post (custom post type). I call get_field() function but i get error that there is no this function. I suppose this is happening because the file can’t see acf functions. How i could solve this problem and run acf methods?
This file i running independently, it’s custom and i want this file to run only when there is a woocommerce order. This file i just for retrieving a value (custom field) according to post id. I call wp-load on my file but with this a can just user wordpress function..not from plugin.
The general thought I get from most other pages is to not do this.
I would probably look for another way to do this without bypassing WP. If you’re going to load all the plugins anyway you may as well load WP. But If I had to do it I would probably use get_post_meta() to get my values instead of using the ACF functions.