Support » Plugin: SVG Support » Inline SVG not working for featured product image

  • Resolved blackfrogdesign

    (@blackfrogdesign)


    Hi,

    I can get the svg to be inline when embedding into the product pages description but for some reason it is not displaying inline when I set it as the products feature image. I assume it’s because the style-svg class is not assigned to it…
    Ticking the ‘Render this SVG inline (advanced)’ still displays the .svg file inside the img tags.

    Any ideas how to get the svg as inline for the products feature image? Thankyou.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    Hi @blackfrogdesign,

    I have created the featured image inline option for regular WordPress posts/pages featured images.

    By the sounds of it, you are using a plugin like WooCommerce or something, which I haven’t tested it with.

    I will actually add this to the feature list because I would certainly like it to support WooCommerce.

    Thread Starter blackfrogdesign

    (@blackfrogdesign)

    That would be fantastic. I am using it alongside a form which the user is able to change the svgs appearance by selecting form elements. A side question… would you know if the user updated svg image would be attached with the Woocommerce order or would it revert to the original default svg image?

    Thanks for your time.

    Plugin Author Benbodhi

    (@benbodhi)

    Wow, this is a very interesting use case.
    Off the top of my head, I don’t think the featured images are attached to orders in WooCommerce… but then again, there is a little thumbnail for each product in the admin when looking at orders.

    I’m in hospital at the moment and I’m the sole developer, so I will look into this as soon as possible, but can’t guarantee anything just yet.

    I’m very interested in your use and would love to set the same thing up in a test environment. Maybe you could export your WordPress install and database so I can set it up locally with the same features and content and work on it specifically relating to your use case.

    My email is wp@benbodhi.com if you would like to send me links to download everything in a zip or something…

    JenkinsTR

    (@jenkinstr)

    Hi Ben,

    I wanted to add here, that I am experiencing similar issues, albeit on a pretty different setup but I am also having some featured image issues.

    So far, the plugin has worked excellently, even in places I wouldn’t expect it to!

    The only stumble so far has been featured images, and I’ve enabled Advanced Mode, and ticked the Inline box under the featured image (which it displays the SVG in the WordPress editor fine, but on the front-end I get nada)

    Inspecting the element hasn’t given me much to go on, but it appears it stops straight after <img class="style-svg">

    So the class is injected, but the actual SVG isn’t. I’ve tried with both the “Render this SVG inline (advanced)” box ticked and unticked.

    I’m using the Enfold theme from Themeforest, which from experience has a pretty lightweight footprint as far as class injection goes for images, so I doubt it’s contributing.
    Honestly, the SVG works in practically every other place or setting, theme specific or not, all except the featured image of a post or custom post type (like a WooCommerce product or Portfolio item)

    Cheers man, and great plugin again 🙂

    -J

    Plugin Author Benbodhi

    (@benbodhi)

    Hi @jenkinstr,

    Thanks for your kind words.
    Please start your own thread and provide a link so I can inspect the code on the front end. I’ll take a look.

    Cheers

    Plugin Author Benbodhi

    (@benbodhi)

    Hi @blackfrogdesign,

    I have done some testing with WooCommerce and it all seems to work fine, just like a post or page.

    I think for the attaching to each order, you would need to write something custom for that to happen.

    I will mark this as resolved for now, but please let me know if you need further help with this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Inline SVG not working for featured product image’ is closed to new replies.