Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter officeemily

    (@officeemily)

    if this isn’t possible, then how do you display a .svg file as the logo.

    currently getting img 0 x 0 (natural 150 x 26 px) and image not displaying, because it’s loading as src.

    any help appreciated.

    Plugin Author neilgee

    (@neilgee)

    You can use svg by allowing the upload of that format, add in functions.php

    //Allow SVG Images Via Media Uploader
    function cc_mime_types($mimes) {
      $mimes['svg'] = 'image/svg+xml';
      return $mimes;
    }
    add_filter('upload_mimes', 'cc_mime_types');

    then upload the svg.

    Thread Starter officeemily

    (@officeemily)

    Thanks for the fast reply, I actually successfully managed to previously upload the .svg file using a variation of your mime uploader to the functions.php file.

    The problem squarely lies in the fact that the vector .svg logo is resizing to 0 x 0 (natural 150 x 26 px) and I’m trying to work out which element is causing the img tag to reduce the vector to 0x0 pixels. Is this related to the visibility of the display:block in css?

    you can see the problem yourself, this is for the xxx nite vibes domain, so the vector logo is simply xxxnv.com, with spaces between the letters.

    i should also point out that we’re using the same set up for 2 other subdomains also running open-source classifieds wp job manager: see this sydney classifieds site here and for our melbourne classifieds where both appear to be displaying the vector ok — and both these sites are supposedly a clone of the main xxxnv.com domain — so im not sure why the vector is failing to show in the main domain? Is this a caching issue?

    A friend suggested that perhaps I can enter the pure svg code as a workaround, but the div slicknav_brand tags don’t seem to allow it.

    Thread Starter officeemily

    (@officeemily)

    hang on neil, i’m going to mark this as resolved. i retested the issue by using the link to the svg on the site’s perth and brisbane subdomains and they both make the vector appear on the main domain fine, so i think it’s basically a problem related to the caching issue. I think the site is running a CDN as well, so it’s related to that and not due to your slicknav_brand script. case over. mark resolved.

    fine to close the thread.

    Plugin Author neilgee

    (@neilgee)

    good stuff – yes caching is a drag with updating.

    Thread Starter officeemily

    (@officeemily)

    thanks for the great support neil.

    so if anyone else is looking for how to upload a vector, all you need to do is what neil said:

    modify your functions.php:

    //Allow SVG Images Via Media Uploader
    function cc_mime_types($mimes) {
    $mimes[‘svg’] = ‘image/svg+xml’;
    return $mimes;
    }
    add_filter(‘upload_mimes’, ‘cc_mime_types’);

    #small point:

    If you’re using Adobe CC like I was you also have the opportunity to modify the svg code in a text editor to ensure the width and height dimensions are the same. adobe cc doesn’t let you directly modify the viewbox on output so you have to do it separately to get your vector looking good.

    thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘text word instead of image logo’ is closed to new replies.