Tag | Computer programming

Three WordPress Syntax Plugins to Show Code Snippets On Your Blog

Jan 7th, 2010View Comments

the matrix Three WordPress Syntax Plugins to Show Code Snippets On Your Blog

If you are writing a blog post about coding, you sometimes have to show examples of the code, so that readers know what you are referring to. However, if you have WordPress and try to add code to a blog post, you will notice that the code you have entered disappears. You might be at a loss on what you can do to resolve this problem, and I have the answer. Here are three WordPress plugins that will allow you to add syntax without any issues:

1.WP-Syntax Plugin

WP-Syntax supports a variety of programming languages that you can display on your blog posts with ease. For example, if I am discussing how to modify something in WordPress, and I want to add a php code string, all I need to do is

wp syntax2 300x25 Three WordPress Syntax Plugins to Show Code Snippets On Your Blog

If it’s another language that you want to display other than PHP, you just need to replace the name in the double quotations to the desired language. For instance, if you want XML, just change it to

wp syntax 1 Three WordPress Syntax Plugins to Show Code Snippets On Your Blog

To color code the code snippets so readers can differentiate between it and normal text, you can modify the WP-Syntax plugin. There is also a WP Syntax Colorizer plugin that extends the WP-Syntax plugin and makes it easier to modify the color coding. It’s very easy to use, and it changes the color of the code snippet, so it is visibly different than your normal text. Note:If you have a blog with different contributors with different user roles, you might have to install a Role Manager plugin. It might give users without Administrator privileges some issues.

2. Google Syntax Highlighter for WordPress

Google Syntax plugin works very similar to the WP-Syntax plugin. The only difference is that the syntax is slightly different. The coding works like this:

google syntax 1 Three WordPress Syntax Plugins to Show Code Snippets On Your Blog

If you want to color code the snippet, then you would need to install the SyntaxHighlighter. The only thing with the Google Syntax plugin is that you might have to add Javascript, if you want some of your code snippets to be viewed properly. This is done by adding:

google syntax 2 Three WordPress Syntax Plugins to Show Code Snippets On Your Blog

3.  Syntax Highlighter WordPress

As the other two plugins, the Syntax Highlighter WordPress plugin allows an easy way to highlight code snippets. It supports different programming languages that can be viewed easily on any post. The format is

syntax highlighter Three WordPress Syntax Plugins to Show Code Snippets On Your Blog

Unlike the other two, the Syntax Highlighter WordPress plugin does not need any other plugins that need to be installed. You can use it on its own.

These are the three best WordPress plugins to use to show code snippets. Now you don’t have to worry about creating images or placing comment brackets around them, so they are viewed properly. Which is your favorite sytnax plugin to use?


Reblog this post [with Zemanta]