Skip Navigation

[Resolved] No img tag at all when img is a svg

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 4 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1504275

I created a view to show the blog entries. Most of the items have an image, but when there isn't one the client has been inserting a sun which is an svg. The Visual Composer has a "post grid" component which displays the svg but it isn't as flexible as using a toolset view. I have the plugin SVG Support installed so I have no problem adding svg files to media library.

If the image is png or jpg the blog div looks like this:
<div class="blog-container"> <img class="attachment-350x250 size-350x250" src="hidden link" width="350" height="250" alt=""><div class="blog-title">Inventor of the Rotating Paddle Holder</div><p>Let me introduce you to the inventor of this rotating paddle holder – Lon Jones! Many of us have encountered the challenge of open play and keeping track of who’s next up and who’s in</p><div class="read-more">hidden link">Read More >></div></div>

but if the image is svg the entire img tag is missing:

<div class="blog-container"><div class="blog-title">Men’s Pickleball Open Singles – So Cal Classic 2014</div><p>Here is a great way to spend the next three minutes of your time…  Check out these clips from the medal winners of the 2014 So Cal Classic in Oceanside, CA. These guys are awesome players</p><div class="read-more">hidden link">Read More >></div></div>

Let me know if you need credentials to log in.

Thanks,
Jim

#1504949

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Please check the following link that shows the default supported mime types by WordPress:
=> https://codex.wordpress.org/Function_Reference/get_allowed_mime_types

As you can see the SVG is not supported by default.

Can you please send me a problem URL and access details and tell me what SVG image you want to add exactly where? Few screenshots would help as well.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1507215

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I see you are displaying the image using the featured image shortcode:

[wpv-post-featured-image size="custom" width="350" height="250" crop="true"]

As you know, by default WordPress does not support the SVG files and Toolset follow the WordPress standards and that is why its not displaying.

We do not support SVG as WordPress does not support it natively, however, I see the SVG uploaded file if I add the shortcode as:

[wpv-post-featured-image]

So, maybe you should check using a conditional shortcode that if the image file is SVG file display the SVG file using shortcocde:

[wpv-post-featured-image]

otherwise

[wpv-post-featured-image size="custom" width="350" height="250" crop="true"]

More info:
=> https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-shortcodes-in-conditions/#checking-custom-shortcodes

#1511215

Hi. It doesn't seem my response from the other day was saved. I tried to register the shortcode by going to settings and got a critical error message. I think I will open a separate ticket for that. I don't want to close this ticket until i have tried the custom shortcode...

#1512967

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok fine - please try custom code and let me know how it goes.