Skip to content

Instantly share code, notes, and snippets.

@temsool
Created November 8, 2022 12:45
Show Gist options
  • Save temsool/a634a4ae140d069690cd140f77c143fc to your computer and use it in GitHub Desktop.
Save temsool/a634a4ae140d069690cd140f77c143fc to your computer and use it in GitHub Desktop.
Add ACF field in WordPress Body Class
<?php
function add_acf_body_class($class) {
$value = get_field('header_height');
$class[] = $value;
return $class;
}
add_filter('body_class', 'add_acf_body_class');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment