Andy6350
asked on
Displaying custom field color picker value in inline style
Hi,
I have setup a custom color picker field called "title_colour" which i have placed inline style on a <h2> tag, however its not displaying the hex value on the front end. This is the code im using:
<h3 style="color:<?php the_field('title_colour'); ?>">Notice Board</h3>
This is the results showing when i inspect the element:
<h3 style="colour:">Notice Board</h3>
This is the link i got the code from
http://www.advancedcustomfields.com/resources/color-picker/
Is there something im doing wrong?
Thanks,
Andrew
I have setup a custom color picker field called "title_colour" which i have placed inline style on a <h2> tag, however its not displaying the hex value on the front end. This is the code im using:
<h3 style="color:<?php the_field('title_colour');
This is the results showing when i inspect the element:
<h3 style="colour:">Notice Board</h3>
This is the link i got the code from
http://www.advancedcustomfields.com/resources/color-picker/
Is there something im doing wrong?
Thanks,
Andrew
ASKER
I have changed the code using the echo command above but it still doesn't appear. There are no specific options in ACF color picker so im assuming its generating a hex string ie #ffffff
Is there any other code i need to include?
Thanks,
Andrew
Is there any other code i need to include?
Thanks,
Andrew
?????
I have never used the AFC color picker, so I can not say what to do, sorry, but I looked and could not find The developers API for this AFC color picker. I did find this for code examples, but it's useless to me? -
http://www.advancedcustomfields.com/resources/code-examples/
I have never used the AFC color picker, so I can not say what to do, sorry, but I looked and could not find The developers API for this AFC color picker. I did find this for code examples, but it's useless to me? -
http://www.advancedcustomfields.com/resources/code-examples/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Figured it out myself
<h3 style="color:<?php echo the_field('title_colour');
and there must be a string in the- the_field('title_colour');