the answer for all question about Oxygen Builder plugin and WordPress

I’ve been using this fantastic tutorial here –

I’ve been using this fantastic tutorial here –
And all works fine. What I’d like to be able to do though is say have a field in ACF to select left, right or centred and then use that within the template to left align, right align or center align an entire sections contents.
Is there any way to get hold of the ACF field content and somehow apply it to the section to do this?
I’m guessing that the sort of thing I need here is some way to take the value of the sub field that I’ve called alignment and then get that into some CSS. Does Oxygen allow PHP inside CSS at all?
I did try but it didn’t work but perhaps there’s some way of doing it that I’m missing?



  1. Mark Bowen says

    Unfortunately having a problem with doing this. Have attached a video to show what’s happening.
    I’ve made some ACF fields which are attached to the Posts CPT all working fine. In my Oxygen Builder Posts template I’ve then got a section with a heading and text component where the heading and content fields are being spat out using the get_sub_field PHP function as mentioned in the tutorial above.
    They come back fine but the problem I have is when trying to create a data attribute on the section. I can create one and give it a static value and that all works fine but as soon as I try to use the PHP return function using get_sub_field then as you can see in the video the section (upon page reload) completely disappears. I’ve tried absolutely everything I can now to get it to work and just can’t get it to play nice. Every single time the section just disappears when trying to use a dynamic value.
    Could anybody possibly put me out of my misery and let me know where I’m going wrong?

  2. Mark Bowen says

    Seems that unless I’m mistaken you can’t utilise Flexible Content fields in this way 🙁 They can be used within say a field to get the contents but as soon as you try to use them inside an attribute using the data option whatever you attach that to disappears on the front end of the site 🙁 Such a shame as it’s such a nice solution too.

Leave A Reply

Your email address will not be published.

Oxyrealm Docs