Home › Forums › Add-ons › Options Page › ACF With PHP Based Style Sheet › Reply To: ACF With PHP Based Style Sheet
The reason why is that you don’t have the post_id and ACF can’t get the post_id. You will need to somehow supply the post_id to the script that’s creating the CSS.
you can get the post ID in the head of a single post like this
$queried_object = get_queried_object();
$post_id = $queried_object->ID;
I don’t know you can get that to the php file, how are you calling it?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.