I have searched the forums and documentation for this — I feel like it’s really very simple, but nothing’s working, so I’ll try here:
I have defined a color picker field in my ACF settings (if it makes any difference, it’s within a flexible content field). Normally, I would write this value into the loop using inline style, but for various reasons I want to put it into the head, inside <style type="text/css"></style>
.
I cannot figure out what I’m doing wrong. My field’s name is item_color, and this is what I’ve written into my functions.php file:
<?php
function acf_css() {
$color = get_field('item_color', 'options');
?>
<style type="text/css"> .item:hover { color: <?php echo $color ?>; } </style>';
<?php
}
add_action( 'wp_head', 'acf_css');
Well, I’ve actually tried several things, this is just the latest. For everything I’ve done, including this, firebug shows the inline style for the item, but the value isn’t showing up, so it just says “.item:hover { color: }”
I’m sure it’s so obvious — what am I doing wrong?