As we can see that there is no special syntax in blogger by which we can highlight the syntax of a code.It is quite easy to do so.we can do this by just inserting few lines of codes in our template html code.You can go through this step by step guide-
Here you will see two options customize and Edit HTML.
Click on the Edit HTML.
Click on save template-
After opening the HTML section of your code enclose your code with the given tags-
<pre class="brush:language name(html) in this case"><----your code's HTML----></pre>
1-Open your blogger dashboard and go to template section
Here you will see two options customize and Edit HTML.
Click on the Edit HTML.
2-Copy the script given below-
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/> <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/> <!-- END INCLUDE SyntaxHighlighter Components --> <!-- INCLUDE YOUR BRUSHES WHICH YOU WANT TO USE HERE --> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/> <!-- END INCLUDE BRUSHES --> <!-- INIT SyntaxHighlighter --> <script type='text/javascript'> SyntaxHighlighter.config.bloggerMode = true; SyntaxHighlighter.all(); </script>
3-Paste the code in the HTML of your template just above </head> tag
Click on save template-
4-After saving template open your post editor and open HTML-
After opening the HTML section of your code enclose your code with the given tags-
<pre class="brush:language name(html) in this case"><----your code's HTML----></pre>
This comment has been removed by the author.
ReplyDeleteHi, i am using this way, but if my websites turn on https, it doesn't work. it only work on http. can you help me please?
ReplyDeleteChange all links on http:// to https:// in your theme
DeleteThank you @KC B for the comment.
ReplyDeletehttps is a secure gateway and google does not allow third party scripts in secure gateway.So it is not working.
Go to setting in dashboard and make https redirects no in basic settings.
and your site will always open on http and this will work.
I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. website development agency
ReplyDeleteThis is working only for http blogger and not working for https blogger. Is there any additional setup required for https bloggers?
ReplyDeleteIt is not working for me . I want to use java brush and included the same in my themes. But it is not working
ReplyDeleteYou are very cool! I dont suppose I have read something similar to this before. So nice to search out somebody with authentic applying for grants this subject. Totally a helpful project for bringing new things for the Sourcecode.
ReplyDeleteI check your blog and it is really information for us Otherwise if anyone want to Learn C & C++ so You Can Contact US-+91-9311002620 Or Visit Our Website- https://www.htsindia.com/Courses/modular-courses/c-plus-plus-training-course
ReplyDeleteI was looking for a post that provides important information and this post meets my expectations. This post is written after a good research and every piece of information seems reliableHow to check the storage on the Gmail app?
ReplyDeleteReally great post that you sharing very informative and very helpful content you put into your blog apart from that if anyone looking for training institute for C++ training checkout then. Contact Here-+91-9311002620 Or Visit Website-https://htsindia.com/Courses/embedded-systems-and-robotics/cplusplustraininginstituteinsouthdelhi
ReplyDeleteGET BEST SYNTEX HIGHLITER SCRIPT HERE
ReplyDeleteThanks for sharing this post its very informative post by the way If anyone look for Ms Office training institute in Delhi Contact Here-+91-9311002620 Or Visit our website https://www.htsindia.com/Courses/microsoft-courses/ms-office-course
ReplyDelete