Last active
January 24, 2018 15:48
-
-
Save chaance/ce5f6fa4e9e17e9912ba20f158480da2 to your computer and use it in GitHub Desktop.
Get URL of the custom logo in WordPress.
This file contains 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
<?php | |
/** | |
* Get theme logo URL | |
*/ | |
function xx_get_logo() { | |
$custom_logo_id = get_theme_mod( 'custom_logo' ); | |
if ( ! $custom_logo_id ) | |
return; | |
$image = wp_get_attachment_image_src( $custom_logo_id , 'full' ); | |
$url = $image[0]; | |
return $url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment