Home › Forums › General Issues › Advanced Custom Field Plugin Option page in CSS WordPress Custom theme › Reply To: Advanced Custom Field Plugin Option page in CSS WordPress Custom theme
You cannot use ACF in a php file like this. WP is not set up and no WP or ACF functions will work in the file.
To do dynamic styles in with ACF you have 3 choices.
1) Put the styles inline in the in the ducument
2) Use admin-ajax.php to generate the style css.
3) Generate a static CSS file on changes
I generally just put it inline. You’re not going to be generating a lot of styles and it’s more efficient and results in better performance to include small chunks of CSS inline.
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!