Languages: English • 日本語 (Add your language)
Retrieves a modification setting for the current theme. Along with set_theme_mod() this function can sometimes offer theme developers a simpler alternative to the Settings API when there is a need to handle basic theme-specific settings.
If the modification name does not exist, then the $default will be passed through sprintf() with the first string the template directory URI and the second string the stylesheet directory URI.
<?php get_theme_mod( $name, $default ); ?>
This example could be used to add the custom background color as a border on the top of the footer. It would be css inserted in the header:
.footer { border-top: solid 1px #<?php echo get_theme_mod( 'background_color' ); ?>; }
Since: 2.1.0
get_theme_mod() is located in wp-includes/theme.php
.
background_color(), set_theme_mod(), get_theme_mod(), get_theme_mods(), remove_theme_mod(), remove_theme_mods()