How to embed gist on wordpress blog without using any plugin

embed gist on wordpress - code-adda.com

If you are writing a tutorial blog post related to programming codes with the sole purpose of sharing the knowledge you might be dependent on any code sharing plugin. Sometimes plugin doesn’t work properly either because of theme or some other reasons and you mess up with fixing code again and again. Nowadays you might be noticing blogger is using GIST for sharing code and at the same time, you may want to do the same but not able to figure out how to embed gist on WordPress blog post. In this blog, I am going to teach you how you can embed gist in your WordPress blog posts.

Simply Use given code in the functions.php file and after that update your functions.php file.

And when you’re done all you have to do is add a link to a post like given below :

[su_note note_color=”#ffe466″]https://gist.github.com/aa0c1dc8d2b334db0d07361c94ea0d8e[/su_note]

The Gist will be embedded in your post. Gist automatically adds your username to the Gist URL, and if you leave(don’t remove) that username in the URL in your post then it won’t embed the Gist on your post– it will simply display the URL on your post.

But removing username from your one or two Gist URL seems ok but what If you are writing a long article and have to embed many Gist URL. It would be a hectic task. Don’t worry!

Simply use given code in the functions.php file and after that update your functions.php file

And when you’re done all you have to do is add a link to a post :
[su_note note_color=”#ffe466″]https://gist.github.com/raviranjankr/b819d3edd1cfaad2c7fa181fe45814dd[/su_note]

Github gists are a great platform to write code and share on your WordPress blog posts quickly.

Happy Coding 🙂

About Ravi Ranjan Kumar 32 Articles
An Indian who Living, Loving & Learning Technology with different tastes and willing to share knowledge and thoughts.

Be the first to comment

Leave a Reply