Description:
As seen on WordPress.com.
SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without having to escape the code or anything. It uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev to do the highlighting and supports all of the package’s parameters via shortcode attributes.
For a list of supported languages (most widely used languages are supported), see the WordPress.com support document.
Example Code Output:
Note that there are various different color schemes available.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>PHP Code Example</title> </head> <body> <h1>PHP Code Example</h1> <p><?php echo 'Hello World!'; ?></p> <p>This line is highlighted.</p> <div class="foobar"> This is an example of smart tabs. </div> <p><a href="http://wordpress.org/">WordPress</a></p> </body> </html>
If you prefer, you can hide the line numbering and other UI stuff with the “light” mode, for example:
[php light="true"]your code here[/php]
There are many other parameters and defaults you can control via the Settings page or the shortcode parameters. Full details and instructions are located at the bottom of the Settings page.
Download:
- Download from WordPress.org (0 downloads)
GitHub:
This plugin is available on GitHub. Issues, patches, and pull requests are welcome.
Pingback: ???????? Linux????? (4) ????????=>WordPress??? | ???????????????
I’ve used this package and it’s absolutely superb. Top job.
It looks like it stops at 299 lines -? Is there a way to remove that limit?
Pingback: What are WordPress Shortcodes? - Gretchen Louise
Thanks for this plugin, I will definitely try this 🙂
Hello again,
I am using bbPress 2.0 and looking into your source code, I found adding support for bbPress 2.0 is really as simple as adding the following line to the __construct of SyntaxHighlighter class
Can you please add it officially?
I’ll be working on some minor updates and freshening up of this plugin this week and I’ll include bbPress 2.0 support. Thanks!
Thank you. To be precise, I am using the latest bbPress 2.4.1.
Pingback: SyntaxHighlighter Evolved | Tidy Repo
Pingback: My first attempt at a WordPress child theme | Technology is cool WHEN it works
Hi, wp eat my code if I go to visual editor.
Pick and editor and stick with it. Switching back and forth can cause issues. There’s not a lot I can do — the visual editor kind of sucks.
Me too. When I copy code to text editor and then swith to Visual editor is gone. But when I reload the page, is again visible. So I don’t care.
plugin is not working now 🙁
It’s working fine for me and everyone else. I don’t know what to tell you. 🙂
I’ve just installed this plugin and it works fine for me. After testing other syntax highlighter plugins at last I found one which is easy to use and works fine. Thanks Viper for this very useful plugin.
Pingback: Wordpress Customization | The Devil In The Details
Pingback: WordPress blog için gerekli 10 eklenti | Sekizncihayat Blog | Webmaster Blogu | HTML5, CSS3, Jquery, PHP, MYSQL
It seams so that your plugin will correct the inserted code. I entered the line
echo -e "This is a Test"
on html editor and I get publishedecho -e \"This is a Test\"
. So the quote signs will be escaped.How could I disable these feature?
Pingback: Source code syntax highlighter plugin for WordPress | p'code
SyntaxHighlighter Evolved shortcodes (ie. “java”, etc.) don’t work with my Sympathique WordPress theme (http://themeforest.net/item/sympathique-responsive-wordpress-theme/5714733). For some strange reason, all shortcode content is replaced by “1”…
After playing a bit with the code, I ended up with the following workaround:
// syntaxhighlighter.php __construct:
foreach ( $this->shortcodes as $shortcode ) {
// add_shortcode( $shortcode, array(this, ‘__return_true’) ); –> this is the cause of the problem.
add_shortcode( $shortcode, array(this, ‘do_nothing’) );
}
…
function do_nothing($atts, $content = null) {}
It seems that the __return_true function is actually called, hence the “1” (true as an int)…
I have no idea what exactly is the cause of the problem, but it has something to do my theme and other people seem to have the same issue with other themes as well (eg. http://themeforest.net/item/sympathique-responsive-wordpress-theme/5714733).
Best.
EDIT (last paragraph): I meant this other theme -> http://www.smooththemes.com/forum/discussion/syntaxhighlighter-doesnt-show-up/
Sorry for the double post…
Pingback: Google Prettify + WordPress | robinadr
Pingback: WordPress??????SyntaxHighlighter?????? | WordPress Tips
@Alex: I did a german translation of this plugin. You might want to include this in your next release. Is there a way to email this to you?
Pingback: phpr.org WordPress temas?! | Emincan ?pekçi
Pingback: ???? | ????
Pingback: Bulldog cafe?????????? | BULLDOG CAFE
Pingback: wordpress ?????? | ???????
hi !
could you help why the special caracters in http://blog.tappenbeck.net/2014/01/25/openstreetmap-in-meine-webseite-einbinden/ will not show correct ?
regards Jan from Germany
Hello Alex,
Just a little message to warn you that I just created a theme based on “Spacegray” for “Sublime Text 2/3” theme.
Thank you for your work on SH. I love it and I hope you’re still improving it, particularly at some missing css tags 🙂
My Spacegray theme (dark and light version) : http://wordpress.org/plugins/syntaxhighlighter-evolved-spacegray/
Hope you’ll enjoy it guys 🙂
great plugin.Exactly the thing which i needed for publishing tutorials.way better than Latex and other competitors.
bbpress support would be a nice add-in. Do you plan to do that?
bbPress is already supported, or at least it should be.
Pingback: Programming: Quellcodevisualisierung | SvenFrank Media
Pingback: Wordpress Plugin für LaTeX Satz und für Code-Listings | holmez blog
Wow. SyntaxHighlighter Evolved is a huge life saver. Thanks for making this so I didn’t have to attempt manual implementation of SyntaxHighlighter from Google.
Pingback: ?worldpress????????? | Jky??????
Pingback: use code tag for better readability | Online toolbag blogs -www.OnlineToolbag.com
Pingback: ??????????wordpress??????? | hvvorks
Pingback: WordPress???????????????????????”SyntaxHighlighter Evolved” | WordPress??
Pingback: WordPress???????????????????????”SyntaxHighlighter Evolved” | WordPress??
Pingback: ??????????????????????????????????SyntaxHighlighter Evolved? | ????????
Pingback: SyntaxHighlighter Evolved | 3kmh
Pingback: WordPress??????????????????????? “SyntaxHighlighter Evolved” | WordPress??
A german localization of this plugin can be downloaded at: http://bitespresso.de/2014/02/deutsche-lokalisierung-fuer-syntaxhighlighter-evolved/
Pingback: WordPress??????????????????????? “SyntaxHighlighter Evolved” | WordPress??
Pingback: How to use org2blog effectively as a programmer | ?????
Pingback: The dangers of editing a published post | Kurt's Comments
Pingback: phpr.org wordpress temas?! | Emincan ?pekçi
Do you have any plans to make v 3 support line wrapping? This is by far the best code formatter out there, but i can’t deal with the horizontal scrollbar. I need to run v 2 because of it.
I didn’t write the Javascript that does the highlighting, I just wrote all of the code that makes it work well with WordPress.
There doesn’t seem to be much traction with getting line wrapping into it: https://github.com/alexgorbatchev/syntaxhighlighter/issues/27
However while looking into it I just found some code that might make it work. I’m currently in the process of rewriting my plugin to make it a lot better and I’ll look into that as a part of my rewrite.
i have a Ask, on the Site stand, for the Problem with BR Tags i can edit the config, but there is nothing a config file. :/ In each line is e br tag, thats very bad.
And i love this Plugin. 🙂
Problem is solved.
Inline Javascript Plugin have make Problems, i have read http://wordpress.org/support/topic/plugin-syntaxhighlighter-evolved-html-tags-gets-added-to-my-code.
I thank you 😉
Pingback: WordPress code tags. | Notes and Observations
Does it has copy code to clipboard system?
You can select and copy text as you would any other text. No need for any special functionality.
Pingback: Highlighting Source Code Syntax in WordPress using SyntaxHighlighter | TechTut.Net