I’m using WordPress with ACF, and I need to use a value of custom fields for CSS. For example, if the value of ACF ‘Name’ is YES, then CSS style just background around that field, if the value of the field is NO, then the background will be red.
I’m using WordPress with ACF, and I need to use a value of custom fields for CSS. For example, if the value of ACF ‘Name’ is YES, then CSS style just background around that field, if the value of the field is NO, then the background will be red.
2
Answers
I think you can easily fix it by if condition. It has value then shows green color otherwise shows red color. you need to replace the CSS class name.
Field: https://prnt.sc/cWvtiZia1KCm
Green value: https://prnt.sc/ZO_4N_ob6J7h
Red value: https://prnt.sc/ApikklLCEhhz
I would do it via classes.
Supposing "WiFi" is a "True/False" custom field: