Dynamically change button color based on dynamic content

Is it possible to dynamically change the color of an element based on the dynamic content?

For instance I have button that is dynamically pulling in a post_tag, the tag has two parameters “Full Time” & “Part Time”. Is it possible to have the button be Green for “Full Time” & Blue for “Part Time”?

Hello @coloradodesigngroup,

Thanks for writing to us.

Regretfully there is no option but you can achieve it through the custom CSS code. You need to go to the Button Element —>Customize —>Element CSS. Add the custom CSS code.

$el.x-anchor{background-color: {{dc:acf:post_field field="your_field_name"}};}

Please have a look at the given screenshot below.

Thanks

Nice, thank you!!

Hey Andew,

You’re welcome! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.