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
https://stackoverflow.com/questions/13001922/how-do-you-handle-dynamic-css-in-wordpress
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!
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.