Have you ever come up with a wordpress coding solution and wanted to share it with others on your blog but the matter of fact is wordpress by default doesn’t allow you to post code snippets in posts or pages. !Da*n it! solution remains a solution for you and not a HELP Article for others…
I recently found myself in the same situation and was cought in another trouble while posting code snippets in posts but in the next hour i was carrying hundreds of solutions for my blog to resolve this problem. I am going to share the best solutions here in this post. Keep reading and dont forget to share it with others. 🙂
Solution begins with a plug and play system. Ofcourse with plugins, we can do that. So here are the best ready made solutions (Plugins) i found on internet.
- 100% client side, no server dependency
- Multiple languages support
- Wide browser support
- Very lightweight
- C++ (cpp, c, c++)
- C# (c#, c-sharp, csharp)
- CSS (css)
- Delphi (delphi, pascal)
- Java (java)
- PHP (php)
- Python (py, python)
- Ruby (rb, ruby, rails, ror)
- Sql (sql)
- VB (vb, vb.net)
- XML/HTML (xml, html, xhtml, xslt)
WP Advanced Code Editor WP Plugin
WP Advanced Code Editor integrates the EasyArea advanced code editor into WordPress. This adds real time syntax highlighting, line numbering, full screen editing, and more to the code editor in the “Add New Post” and “Add New Page” screens.
Requires: 2.3 or higher Compatible up to: 2.7
Developer Formatter WP Plugin
- Non-obstructive filter integration.
- Syntax highlighting with Style attribute enabled.
- Syntax highlighting using AJAX.
- Syntax highlighting in RSS 2.0 feeds.
- Syntax highlighting with PRE tags .
- Syntax highlighting in comments.
- Start line number configuration.
- Hide toolbar for a code block.
- CSS !important to for better style.
- New code theme (Summer)
File Inliner WP Plugin
This plugin displays the content of a file in a post. The content of the file (called a “snippet”) is put in a
<pre></pre> block by default.
It has the following advantages over pasting the content of the file in your post yourself:
- When the file is modified, no need to modify the posts referring to it
- Indentation is preserved by default (useful to show code snippets)
- Can optionally provide a link to the file (no need to copy-paste your snippet)
If requested (see the
preserveformat parameter), the content of the file is put in a
<div></div> block, with each line (delimited by the carriage return) in its own
Code Snippet WP Plugin
Code Snippet was created by Roman Roan and originally hosted at http://blog.enargi.com. It is powered by the GeSHi engine and is quite possibly the best syntax highlighting engine for WordPress. A large number of languages are supported and it can be easily extended. Since his blog is no longer functioning, I’m attempting to keep his wonderful contribution available so I’ve given it a home at http://blog.hackerforhire.org/code-snippet/. If you find any bugs with it, let me know and I will do my best to resovle them.