Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Add SVG as logo the7
//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_log ' . esc_attr( $class . ' preload-me' ) . '"src="' . $default_logo[0]. '" alt="' . esc_attr( $alt ) . '">';
return $my_logo;
}
.my_svg_log{
height: 40px !important;
}

Thank you, much appreciate it!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment