When I write blogs which explains something using code snippet, i used to add the code directly and blockquote it later i find some plugins which will render the code in the readable format with syntax highlighting, later i used to add code snippet in GIST and embed in post using some plugins, recently i got a chance to read this post
Which lets you to embed the GIST code in your blog post without any additional plugins with simple steps
- Login to WP_admin
- In WordPress admin console
- Goto Appearance > Editor > Select the current theme and click on functions.php
- Paste the below code snippet to your WordPress theme function.php file
and simply add your gist url without the username
Say, if this is my URL https://gist.github.com/asvignesh/61b7f687f249a61e3117
add to post as https://gist.github.com/61b7f687f249a61e3117 which will automatically embed as code snippet
if you want to embed particular file, use file query string https://gist.github.com/56654ec2130b5271f97a?file=MyClass.java