Created
February 24, 2017 09:30
-
-
Save digamber89/f245e4f0a2bc6211a3f58ff62d73cb0e to your computer and use it in GitHub Desktop.
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 | |
// this is a hack | |
// assumption is the uploaded image will be 2x size of actual image used | |
// for example image will be displayed as 225 * 90 px so upload image needs to be 500 * 180 | |
// so image size added using image size would be add_image_size( 'site-logo', '225', '90', true ); | |
$custom_logo_id = get_theme_mod( 'custom_logo' ); | |
$logo = wp_get_attachment_image( $custom_logo_id , 'site-logo'); | |
if ( has_custom_logo() ) { | |
//the_custom_logo(); | |
echo '<a href="'.home_url().'">'; | |
echo $logo; | |
echo '</a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment