• Did I fault if logo.SVG HTML output has no dimensions?

    SVG support:

    function svg_upload ($svg_mime) {
        $svg_mime['svg'] = 'image/svg+xml';
        return $svg_mime;
    }
    add_filter( 'upload_mimes', 'svg_upload' );

    Custom logo support:

    add_theme_support( 'custom-logo', array(
      'height' => 38,
      'width' => 162,
      'flex-height' => true,
      'flex-width' => true,
     ));

    Im using customizer to upload logo. Why are dimensions ignored? If I take a look to other sites that use logo.SVG, <img> include dimensions.

    Thanks you

Viewing 7 replies - 1 through 7 (of 7 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What is the HTML output of your logo?

    Thread Starter gore.m

    (@gorem)

    <img src="http://localhost/floris1/fl-content/uploads/Floris-logoSVG.svg" class="custom-logo" alt="Květiny FLORIS Brno" itemprop="logo" id="exifviewer-img-1" exifid="96843896" oldsrc="http://localhost/floris1/fl-content/uploads/Floris-logoSVG.svg">
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Does the issue persist in the Twenty Sixteen theme with all plugins deactivated?

    Thread Starter gore.m

    (@gorem)

    Im using Underscore _S. I have only few plugins installed (Woo etc).

    Thread Starter gore.m

    (@gorem)

    Im sorry, I didnt understand. Yes, this issue persist in the Twenty Sixteen theme with all plugins deactivated.

    Thread Starter gore.m

    (@gorem)

    Is it WP bug?
    Thanks you

    It’s not a WordPress bug. Dimensions with SVG are a strange beast. You’ll need to use some CSS and maybe modify the SVG to get the right behaviour. This article is a good overview of the issue and techniques to solve it: https://css-tricks.com/scale-svg/

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Custom-logo / SVG / dimensions ?’ is closed to new replies.