Syntax
get_theme_mod(string $name, string|false $default = false)
Usage
get_theme_mod() is used to filter the theme modification, retrieve all the theme modifications.
Add this below code in wp-includes/theme.php to do the same.
<?php Function get_theme_mod($name, $default = false) {
$mod = get_theme_mods();
if( isset( $mod [ $name ] ) ) {
Return apply_filters( "theme_mod_{$name}", $mod[ $name ]);
}
if ( is_string( $default ) ) {
// Only run the replacement if an sprintf() string format pattern was found.
if ( preg_match( '#(?<!%)%(?:\d+\$?)?s#', $default ) ) {
$default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );
}
}
return apply_filters( "theme_mod_{$name}", $default );
}
In header.php add,
<?php get_theme_mod( $name, $default );?>