Support

Account

Home Forums Front-end Issues Div Background color ACF Reply To: Div Background color ACF

  • Hi,

    What you would need to do would be something along the lines of:

    
    <?php if(get_field('color')) {
    $color = get_field('color'); ?>
    <div class="title-item" style="background-color:<?php echo $color ?>;">
    <?php } else { ?>
    <div class="title-item">
    <?php } ?>
    <h4><?php the_title(); ?></h4>
    </div>