Skip Navigation

[Resolved] How to add css based on value of custom field?

This support ticket is created 3 years, 2 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 3 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#1911009

Hi there.

I have a table where the first column shows the Post Title Link.

<div class="tb-field" data-toolset-blocks-field="1" data-last-update="1.4">[tb-dynamic provider="__current_post" post="current" source="post-title-with-link" force-string='first' ]</div>

How can I modify this code to change the cell color based on the value of a custom field (wpcf-payment-data-status)?

If you can provide the code, that would be great!!

Also, I'm using the Blocks interface, so how would I enter the code you provide?

Thanks in advance.

#1911577

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Amin,

Thank you for contacting us and I'd be happy to assist.

You can achieve this in the Blocks editor, by using the conditional blocks.

In your target cell, you can include the conditional blocks for each possible value of the custom field "wpcf-payment-data-status".

This will allow you to style the contents of those blocks independently, for each value's case.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.