Created
December 20, 2018 12:53
-
-
Save yousufansa/367b6828f897a60844515f721698f2ab to your computer and use it in GitHub Desktop.
Wordpress Custom Logo URL
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
| if ( ! function_exists( 'wordpress_custom_logo_url' ) ) { | |
| function wordpress_custom_logo_url( $html, $blog_id ) { | |
| $logo_url = '#your_custom_link'; | |
| $custom_logo_id = get_theme_mod( 'custom_logo' ); | |
| if ( $custom_logo_id && ! empty ( $logo_url ) ) { | |
| $html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>', | |
| esc_url( $logo_url ), | |
| wp_get_attachment_image( $custom_logo_id, 'full', false, array( | |
| 'class' => 'custom-logo', | |
| ) ) | |
| ); | |
| } | |
| return apply_filters( 'jh_child_custom_logo', $html, $blog_id ); | |
| } | |
| } | |
| add_filter( 'get_custom_logo', 'wordpress_custom_logo_url', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment