How To Add Code Snippet To Blogger

Friday, October 07, 2016 No Comments

This post may contain referral links. For more info, please read my disclosure policy.


Blogger is a beautiful place to blog in, not withstanding all the discouragements you may get from some bloggers who do not fancy blogger. 
have you been looking for a way to add code snippet to blogger and you do not want to use the blockquote system? 
Well worry no more because the best option is here for you... 

How to Enable Adding Code snippet in Blogger

1. Back up your template. 
2. Go to html in your template section 
3. Search for </head>, copy the code below and paste into your Blogger's template file, right above </head> tag.

<link href='http://alexgorbatchev.com/pub/sh/2.1.382/styles/shCore.css' rel='stylesheet' type='text/css'/> 
<link href='http://alexgorbatchev.com/pub/sh/2.1.382/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shCore.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushCpp.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushCSharp.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushCss.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushJScript.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushPhp.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushPython.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushRuby.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushSql.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushVb.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushXml.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushPerl.js' type='text/javascript'/> 
<script language='javascript'> 
SyntaxHighlighter.config.bloggerMode = true; 
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/2.1.382/scripts/clipboard.swf&#39;; 
SyntaxHighlighter.all(); 
</script>

now save your template... 

when ever you want to add a code to your blog post, parse the code here or learn how to add code parser to your blog. After parsing, wrap the parsed code snippets inside the tags: <pre class="brush: language-name"> </pre>


Note replace Language-name with your preferred brush name. Brush name looks like this shBrushPerl, you are to pick perl if that's the brush name you prefer. 

and that's it... 

Blog Archive

Contact / Address

Mr Sunday Joseph's Compound,
Off Goodnews street, Azikoro,
Yenagoa Bayelsa State
Nigeria.
Zipcode: 569101

Reach Us on
+2348122329659
or
Contact@blogtrovert.com

Blog Owned and managed By:
Joseph Onome.