Skip Navigation

[Resolved] Make DIV background color equal color picker value

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 1 voice.

Last updated by gaborG 6 years, 6 months ago.

Author
Posts
#376560

I added a discount label feature to make courses pop out from the grid when they have a discount going on. There are 2 kinds of discounts: %-based and $-based. I want to give them a different color. I added a color value to the Discount custom post type which is picked up from a color-picker. I want to pass the color to the div's background like this:

<div class="discount" style="background-color: [types field='label-color'][/types];">

Unfortunately it doesn't work. How can I make it work?

#376561

Nevermind. I just forgot to add id="$discount". Silly me.