Last active
October 9, 2020 13:24
-
-
Save bigdigital/59ada0c2a993af95eefd7dad156006cc 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
what am i doing wrong? svg will not appear