Hello,
I was wondering if anyone could help me and figuring out why my code will not work? I’m trying to set the color picker value as a CSS var. This was the colors of my site change based on the color the user picked on their profile.
Thanks!
<?php function primary_brand_color(){
$branding = get_field('primary_brand_color', '"user_" . get_current_user_id()');
echo '<style type="text/css">
:root{--branding:'.$branding.';}
</style>';
}
Hi @christianj40
What does $branding output?
If I did it correctly in the code it should output the color picker field in the user’s profile.