Hi all, another day, another question
I would like to change the attributes of an element dynamically, based on data contained in the post. For instance, I want each post in a Wordpress loop to have a title of a different colour, defined per-post.
I thought of using Wordpress Custom Fields. By storing the colour’s hex in a Custom Field, I should be able to retrieve it in a Wordpress loop bloc via the shortcode
However, I am not sure how to apply it in any meaningful way. I can’t use shortcodes in the values of the class via the editor, and I can’t put a shortcode as the class name, as Blocs would immediately convert it to an actual class name:
I also thought of Custom Attributes, but any custom attribute that would allow me to do that automatically (like for instance
style, etc) is reserved.
As usual, happy to hear of other solutions entirely! Thanks.