How do I include SVG file used as featured image?

First, you don’t need the URL but the server path to the file, you can get it with get_attached_file function, passing any WordPress attachment ID as a parameter. Then you need to load the contents of that SVG file directly, via file_get_contents function and echo it out to the page. $thumbnail_id = get_post_thumbnail_id( get_the_ID() ); … Read more

How to prevent WordPress to remove my embedded SVG images

I think you are missing dimension properties (height and width) while adding it in HTML, that’s why it is not appearing. For SVG files height and width is compulsory if you align it center or left without giving dimensions property it will break. I faced the same issue when I started my ChartExpo project.

SVG Featured image not shown in twitter

Twitter has some limitations upon file extensions. I see that you’re passing on some variables within your meta tag. https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/markup.html URL of image to use in the card. Images must be less than 5MB in size. JPG, PNG, WEBP and GIF formats are supported. Only the first frame of an animated GIF will be used. … Read more

Insert SVG code (not img) in HTML block

I tried this code on a clean install of WordPress <svg width=”100″ height=”100″> <circle cx=”50″ cy=”50″ r=”40″ stroke=”green” stroke-width=”4″ fill=”yellow” /> </svg> and used ‘Custom HTML’ in Guttenberg in a new post. This worked fine for me. The same code displayed in the DOM without deleting any tags or adding any Maybe you cant edit … Read more

Disable automatig SVG tag from menu

Copy functions.php from the parent theme into your child theme. Edit functions.php to remove the offending SVGs. NOTE: if wp_nav_menu() is called from another file (e.g., header.php), copy and edit that one instead.