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 :
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 :
Github gists are a great platform to write code and share on your WordPress blog posts quickly.
Happy Coding 🙂