When i am trying to add hex color its crossed out in frontend and if i add color directly i.e. black or white it works ..how can i fix this issue.
This one does not work
function my_styles_method() {
wp_enqueue_style(
'custom-style',
get_template_directory_uri() . '/css/custom_script.css'
);
$color = #FF0000 ;
$custom_css = "
.mycolor{
background: {$color};
}";
wp_add_inline_style( 'custom-style', $custom_css );
} add_action( 'wp_enqueue_scripts', 'my_styles_method' ); ?>
But this one works
function my_styles_method() {
wp_enqueue_style(
'custom-style',
get_template_directory_uri() . '/css/custom_script.css'
);
$color = black;
$custom_css = "
.mycolor{
background: {$color};
}";
wp_add_inline_style( 'custom-style', $custom_css );
} add_action( 'wp_enqueue_scripts', 'my_styles_method' ); ?>