We're merging with GenerateBlocks! Learn more here.

Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Set background colour with acf field value Reply To: Set background colour with acf field value


Sorry Tom, that snippet didn’t work. I substituted my actual acf field name ‘background-colour’ for ‘_my_color’. I then tried setting $color = ‘#666’ to see if a hard-coded hex value would work in case acf wasn’t being set — this added a background colour to the whole wpsp wrapper, not behind each individual item (wp-show-posts-inner).

Is there another way to dynamically set the background colour of each wp-show-posts-inner element to an acf value from the post?