Created
November 8, 2022 12:45
-
-
Save temsool/a634a4ae140d069690cd140f77c143fc to your computer and use it in GitHub Desktop.
Add ACF field in WordPress Body Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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