We're merging with GenerateBlocks! Learn more here.

Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Set background colour with acf field value Reply To: Set background colour with acf field value

#5888
Tom
Keymaster

Hey Paul,

You could try something like this:

add_filter( 'wpsp_settings', function( $settings ) {
    $color = get_post_meta( get_the_ID(), '_my_color', true );
    
    if ( $color ) {
        $settings['inner_wrapper_style'][] = 'background-color:' . $color;
    }

    return $settings;
} );

Let me know 🙂