WordPress.org

Forums

SVG Shortcode
[resolved] How to use SVG files inside a php template, not as a shortcode (4 posts)

  1. halfaro
    Member
    Posted 1 year ago #

    Hello, I've seen that is really easy to use SVG files inside a entry or post just by using the shortcode, BUT how to use SVG inside a template in the code?
    Thanks,

    https://wordpress.org/plugins/svg-shortcode/

  2. amrendesign
    Member
    Plugin Author

    Posted 1 year ago #

    Hello, if you wish to include an svg-file in a template, you can use the <object> way. F.ex:
    Say you have an svg-file called "mysvgfile.svg"

    <object data="/path-to-your-file/mysvgfile.svg" type="image/svg+xml"></object>

    There is a bunch of ways you can include svg-files, more ways listed here:
    http://css-tricks.com/using-svg/

    Just make sure the plugin is active so wordpress renders the files.

    Br
    Martin

  3. halfaro
    Member
    Posted 1 year ago #

    Thanks for the reply and the very useful link.

  4. amrendesign
    Member
    Plugin Author

    Posted 1 year ago #

    Glad I could help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • SVG Shortcode
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.