Skip to content

Instantly share code, notes, and snippets.

@icetee
Last active January 25, 2021 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icetee/c03c52ed08c099e6b8aaaa1808114944 to your computer and use it in GitHub Desktop.
Save icetee/c03c52ed08c099e6b8aaaa1808114944 to your computer and use it in GitHub Desktop.
WordPress Customize - Add hover logo
// 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');
@StonehengeCreations
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment