Created
September 30, 2023 14:57
-
-
Save terrylinooo/688c80e87918fd703d18bd9ff37afa9a to your computer and use it in GitHub Desktop.
get_theme_mod
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
/** | |
* 鐵人賽示範:自訂背景顏色 | |
* | |
* @return void | |
*/ | |
function ironman_customizer_css() { | |
$background_color = get_theme_mod( 'ironman_background_color_setting', '#ffffff' ); | |
?> | |
<style type="text/css"> | |
body { | |
background-color: <?php echo esc_attr( $background_color ); ?>; | |
} | |
</style> | |
<?php | |
} | |
add_action( 'wp_head', 'ironman_customizer_css' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment