-
-
Save f7en/db4e926b824e76da438ca1cd445cdf93 to your computer and use it in GitHub Desktop.
Add SVG as logo in The7 theme
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
//to able to use svg you can install following plugin https://uk.wordpress.org/plugins/svg-support/ | |
function presscore_get_logo_image( $logos = array(), $class = '' ) { | |
if ( ! is_array( $logos ) ) { | |
$logos = array( $logos ); | |
} | |
// get default logo | |
foreach ( $logos as $logo ) { | |
if ( $logo ) { | |
$default_logo = $logo; | |
break; | |
} | |
} | |
if ( empty( $default_logo ) ) { | |
return ''; | |
} | |
$alt = get_bloginfo( 'name' ); | |
$my_logo = '<img class="my_svg_logo ' . esc_attr( $class . ' preload-me' ) . '"src="' . $default_logo[0]. '" alt="' . esc_attr( $alt ) . '">'; | |
return $my_logo; | |
} |
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
.my_svg_logo{ | |
height: 40px !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment