If I manually enter a value, the class is output fine, if I use an acf field, no class is added. Am I missing something to make this work? I tried on cpt templates as well as single pages, same results.
Thanks a lot for the screencast, I found the culprit. Turns out it doesn’t work with option pages. If I set the field group to only show on pages and/or posts, but not on option pages, it works as expected. Could’ve thought of testing that way myself first haha, brain was fried I guess.
I’ll try n go into more details of how it doesn’t work with options pages but I’d be happy to dm or mail you some logins.
When I now add the new field for the class (regular text field) and output that anywhere inside the template, it also works as expected.
If I however, put that field into the Body Class field, it doesn’t work.
My assumption, no clue how right or wrong it might be, is that the Body Class field doesn’t expect/check for fields coming from option pages. Or even if it does, it doesn’t add the ‘option’ attribute to the get_field('field_name', 'option') function from ACF. It seems to only work when the value is being pulled from a single page/post.
I can’t confirm that. Works for me with an options page as well.
If you use the same field group for posts / pages and option pages Bricks probably won’t know which one to pull.
Not sure what your exact scenario is. Maybe you create a small helper function to fetch and return the body classes like you want and then use this function in the page settings: {echo:my_body_classes_function}.
Hmm damn it, thought I found the rootcause haha. I did try with a separate group but same result. Anyways, helper function is a good workaround and I’ll keep investigating what I did to mess up the functionality. Thanks for the help