Hi.
I’m using the following code inside <head>, knowing that theres a style.css loaded.
<?php
$cssstyle = get_field ('bm_fundo_cor');
if ( $cssstyle != "" ) {
?>
<style type="text/css">
body {
background-color: <?php the_field( $cssstyle ); ?> !important;
}
</style>
<?php } ?>
Why the $cssstyle doesn’t work when called at the_field?
Thank you.
because $cssstyle = a color value and not a field name
<?php
$cssstyle = get_field ('bm_fundo_cor');
if ( $cssstyle != "" ) {
?>
<style type="text/css">
body {
background-color: <?php echo $cssstyle; ?> !important;
}
</style>
<?php } ?>
Thank you for your kind help 🙂