SyntaxHighlighter2 allows you to easily post syntax highlighted code all without loosing it’s formatting or making an manual changes.
It supports the following languages (the alias for use in the post is listed next to the name):
- AS3 —
- C++ —
- C# —
- ColdFusion –
- CSS —
- Delphi —
- Diff/Patches —
- Erlang —
- Groovy —
- Java —
- JavaFX —
- Perl —
- PHP —
- Plain text —
- PowerShell —
- Python —
- Ruby —
- Scala —
- SQL —
- VB —
- XML/HTML —
Other BBCode Methods
too long to type? Here’s some alternative examples:
Updgrading From A Previous Version
To upgrade from a previous version of this plugin, delete the entire folder and files from the previous version of the plugin and then follow the installation instructions below.
Uploading The Plugin
Extract all files from the ZIP file, making sure to keep the file structure intact, and then upload it to
This should result in the following file structure:
- wp-content - plugins - syntaxhighlighter2 | readme.txt | screenshot-1.png | syntaxhighlighter2.php - files | clipboard.swf | shBrushCpp.js | shBrushCSharp.js | [...] | shCore.js | wrapping.png
Go to the admin area of your WordPress install and click on the “Plugins” menu. Click on “Activate” for the “SyntaxHighlighter” plugin.
Just wrap your code in
. The language attribute is required! See the plugin’s description for a list of valid language attributes.
- The BBCode in my post is being replaced with <pre>’s just fine, but I don’t see the syntax highlighting!
Make sure your theme’s footer has
- I still see the BBCode in my post. What gives?
Make sure you correctly use the BBCode with a valid language attribute. A malformed usage of it won’t result in replacement.
- Is this plugin licensed under GPL?
- Can I hide the toolbar, ruler, etc?
Yes, you can give any of the options mentioned in http://alexgorbatchev.com/wiki/SyntaxHighlighter:Configuration#SyntaxHighlighter.defaults
as option attribute. See example bellow.
There are no reviews for this plugin.
Người đóng góp & Lập trình viên
“SyntaxHighlighter2” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.Những người đóng góp
Nhật ký thay đổi
- Compatibility with WordPress 3.0
- Styling issue after upgrade
- Theme Eclipse added
- Upgraded to SyntaxHighlighter 2.1.364
- Options are not always picked up properly
- Brush not found alert shown in admin section when there is code in user comment
- If there is no space between ‘ and ] parser fails
- Allow for options. Hide the toolbar, ruler, etc.
- Select whether to apply the code highlighting to user comments in ‘Settings’ -> ‘SyntaxHighlighter2’
- Added bash (shell, sh) and patch syntax
- Mention license in readme.txt
- GPL credits
- Added support for theming
- Plugin options page to choose the theme
- Added visibility to properties and methods
Version 1.1.1 (SyntaxHighlighter)
- Encode single quotes so
wptexturize()doesn’t transform them into fancy quotes and screw up code.
Version 1.1.0 (SyntaxHighlighter)
- mdawaffe fixed an encoding issue relating to kses and users without the
unfiltered_htmlcapability. Mad props to mdawaffe.
Version 1.0.1 (SyntaxHighlighter)
- Minor CSS fixes.
- Filter text widgets to allow posting of code.
Version 1.0.0 (SyntaxHighlighter)
- Initial release!