When you embed HTML or PHP code in your posts or pages, you get strange result when you render your page. WP-Syntax plugin gives you all the power you need to select the language you want to embed, line numbers and syntax highlighting according to language you choose.
Here is the list of the languages this plugin supports.
abap, actionscript, actionscript3, ada, apache, applescript, asm, **asp**, autoit, **bash**, blitzbasic, bnf, **c**, c_mac, caddcl, cadlisp, cfdg, cfm, cpp-qt, **cpp**, **csharp**, **css**, d, delphi, diff, div, dos, dot, eiffel, fortran, freebasic, genero, gettext, glsl, gml, groovy, haskell, **html4strict**, idl, ini, inno, io, **java**, **java5**, **javascript**, kixtart, latex, lisp, lotusformulas, lotusscript, lua, m68k, matlab, mirc, mpasm, mxml, **mysql**, nsis, **objc**, ocaml-brief, ocaml, oobas, **oracle8**, pascal, per, **perl**, php-brief, **php**, plsql, **python**, qbasic, **rails**, reg, robots, **ruby**, sas, scala, scheme, sdlbasic, smalltalk, smarty, **sql**,
tcl, text, thinbasic, tsql, **vb**, **vbnet**, verilog, vhdl, visualfoxpro, winbatch, **xml**, xpp, z80
Languages with in the stars highlight the popular ones. I am amazed to see that this plugin is supporting Foxpro also. Cool!!!
Visit this link for more information. http://qbnz.com/highlighter
You have to wrap the code between <pre> </pre> tags. Line value is optional.
<pre lang=”LANGUAGE” line=”1″> </pre>
If this plugin is producing strange results, try editing code without visual editor. To turn off visual editor navigate to Users > Admin and turn off Use the visual editor when writing option. You can create another account with all the privileges and turn off visual editor for that account. So whenever you want to edit a post where wp-plugin is used, first login using that account.

Lets start the installation process.
1. Download WP-Syntax plugin.
2. De-compress files locally.
3. Upload, wp-syntax folder to \wp-content\plugins directory.
4. Open http://www.yourdomain/wp-admin/plugins.php in your browser or click on the Plugins url in your dashboard. Activate the plugin.
5. Write a new test post and play with plugin.
Here are few possibilities..




This plugin also let the anonymous commenter to use the pre tag. Create a test page and type in some code inside pre tag.

Switch to dashboard for approving the comment. Voila… it shows that highlighting there.

Approve the comment and check it in post.

You can find default styling CSS file at wp-content/plugins/wp-syntax/wp-syntax.css. This is basic layout. To customize style copy this file to your theme template directory. If a file wp-syntax exists in the theme directory this file, that file will be used instead of default.
As you can see this plugin is very powerful and versatile. Use it.
I hope this article will be useful for you.









1 Comment Already
Pingback & Trackback
Related Post
Please Leave Your Comments Below