Lego2012
9/26/2016 - 10:15 PM

Use Genesis Attributes to add Inline Styles

Use Genesis Attributes to add Inline Styles

<?php

// Add background-color to .footer-widgets
add_filter( 'genesis_attr_footer-widgets', 'ap_attributes_footer_widgets' );
function ap_attributes_footer_widgets( $attributes ) {

    $background = get_field('footer_widgets_bg', option);

    $attributes['style'] = 'background-color:' . $background . ';';
    return $attributes;
}