Skip to content

Instantly share code, notes, and snippets.

@chaance
Last active January 24, 2018 15:48
Show Gist options
  • Save chaance/ce5f6fa4e9e17e9912ba20f158480da2 to your computer and use it in GitHub Desktop.
Save chaance/ce5f6fa4e9e17e9912ba20f158480da2 to your computer and use it in GitHub Desktop.
Get URL of the custom logo in WordPress.
<?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