Skip to content

Instantly share code, notes, and snippets.

@bryanwillis
Forked from SiGaCode/acf_gen_attr01.php
Created December 15, 2015 08:18
Show Gist options
  • Select an option

  • Save bryanwillis/1adeabc36da192d21360 to your computer and use it in GitHub Desktop.

Select an option

Save bryanwillis/1adeabc36da192d21360 to your computer and use it in GitHub Desktop.
Use genesis_attr to add inline styles via ACF
// 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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment