Colour picker in ACF WordPress (Php)

Archie Makuwa
Sep 17, 2021

This is not a story, just a referral for when working with colours in PHP, WordPress and Advanced Custom Fields (ACF).

I saved it here as some form of reference, sorry if it makes no sense :-(

Here’s a custom PHP solution that we’ve used for one of our projects so that we don’t require another additional plugin. You should only need to replace ‘final_section_text_background’ with your own custom field name. Opacity value can be adjusted using $rgba = hex2rgba($color, 0.8); — replacing 0.8 with your own preferred opacity level.

--

--

Archie Makuwa

I totally suck at everything. I think I love music and sometimes good code. I know I totally love dogs...