Last active
January 25, 2021 00:42
-
-
Save icetee/c03c52ed08c099e6b8aaaa1808114944 to your computer and use it in GitHub Desktop.
WordPress Customize - Add hover logo
This file contains hidden or 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
// Use: | |
// get_theme_mod('theme_hover_logo'); | |
function theme_customizer_setting($wp_customize) { | |
$wp_customize->add_setting('theme_hover_logo'); | |
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'theme_hover_logo', [ | |
'label' => 'Upload Hover Logo', | |
'section' => 'title_tagline', | |
'settings' => 'theme_hover_logo', | |
'priority' => 8, | |
])); | |
} | |
add_action('customize_register', 'theme_customizer_setting'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you please explain to me how to use get_theme_mod('theme_hover_logo') ? Because I cannot find any documentation on the actual usage. I am trying to get the custom logo to be in another color when hovered over it.