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: El Top 100 de los Plugins de WordPress para su Sitio | Eduarea's Blog
Very nice plugin. Thank you
What a plugin! Excellent.
how to specify tab in wordpress visual editor is their any tutorial about how to use this plugin
Pingback: Code in WordPress (SyntaxHighlighter Evolved) | Daniels Blog
Pingback: Show jQuery Source Code In Your WordPress Blog | jQuery4U | No.1 Resource for jQuery Developers
Pingback: Làm ??p code trong blog v?i SyntaxHighlighter | Backtrack - Pentesting - MMO - CEH - SEO
Pretty neat and very easy to use
How do we format xml code ? Do we use xml brush here ? It does not work and breaks formatting down below.
This is the post I am seeing issue
http://www.skill-guru.com/blog/2010/01/13/asynchronous-method-invocation-in-spring-3-0/
It doesn’t look like you are wrapping your XML in my plugin’s shortcode. It works fine if you do:
http://alexpublictest.wordpress.com/2014/04/25/syntaxhighlighter-with-xml/
(Yes, that’s WordPress.com but it’s the same plugin.)
Got it working, Thanks
Great job on the plugin!
Pingback: Using Custom Theme with SyntaxHighlighter Evolved | Biboroku
I’ve just updated WordPress and this pug-in after having them installed for a very long time without updates. Now all quotes and amps are getting converted to ampersand character codes but doubled. so in my code on the page there are tons of quote, amp, gt and lt codes showing. I feel like I fixed this before by editing something in the plug-in or maybe in a WordPress file. can you please point me in the right direction. Thanks.
How old are we talking about? What version of my plugin were you using before?
I never use the visual editor but after updating WP and your plugin I had to switch to visual editor and then back to the text editor and everything is working again. Thanks.
Pingback: Cómo añadir código embebido dentro de nuestros post en WordPress | INFOTIPS
I am using WP 3.9 + Jetpack Markdown (2.9.3) + your Syntax Highlighting Evolved. Mostly great, but:
If my listings contain ‘greater’ or ‘lesser’ or ‘ampersand’ or ‘double quotation mark’, Markdown recodes them to HTML entities like _gt_, _ls_ etc. Without your plugin, code is still shown correct. But with your plugin, the listings contain _gt_ etc. instead of ‘greater’.
Don’t know who is to blame. Any ideas how to resolve this? Thank you!
If you’re going to use Markdown, then use it for posting code too using triple backticks. The Markdown module should detect that my plugin is installed and use it to render the code.
triple backticks is exactly what I am using;
without SHE
http://ubuntu-buch.info/cms/?p=238
with SHE
http://ubuntu-buch.info/cms/?p=242
well very nice plugin… i am using it here http://aamirshahzad.net my blog i found it very useful and easy to use…thanks for great work
Pingback: Wordpress Plugins I can't live without - By Mike Hudson
Pingback: WordPress??????SyntaxHighlighter?????? | ????
Hi Alex,
thanks a lot for creating the plugin! I was just wondering, is there any way I can add a custom css template? If yes, how can I do it?
See http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/adding-a-new-theme/
Many thanks Alex!
Alex,
If we are also using the Speed Booster Pack plugin, setting Defer parsing of javascript files seems to break your plugin. I tried other plugins that ‘Defer parsing of javascript files’ and the same issue occurred.
I would love an update that worked with ‘Defer parsing of javascript files’ enabled.
Looks like when the javascript goes to run, I get this error in chrome:
Uncaught ReferenceError: SyntaxHighlighter is not defined
Later,
Jared
Did you solve it? How did you do it? Thank you.
HI THERE! I’m using your plug in and it seems to work fine except after i update the page a coupe of times (without editing anthing in the edit page, it starts changing characters. for example: ” for ". do you know how can i prevent this? i’m using csharp
thanks!
Pingback: WordPress Plugintipp – SyntaxHighlighter Evolved | just4testing.com
Pingback: The Top 100 WordPress Plugins For Your Site | HumanART
Pingback: Ciseco - Posting code with brushes
Just installed. Works as expected. Thank you, very much 🙂
Awesome and my favorite plugin for syntax highlighting. Having a little issue and need solution or suggestoin, I can’t show php syntax for do_shortcode function.
To avoid your code getting mangled, my plugin processes its shortcodes earlier than WordPress processes them by default.
Try doing
apply_filters( 'the_content', '[php]blah[/php]' )
instead.Pingback: ????????? | bassen_blog
I’d love to see this plugin work if using the “Delay JavaScript” feature of the “Speed Booster Pack” plugin. Currently, I have Speed Booster Pack enabled, but I had to disable the “Delay JavaScript” feature.
Hi Alex, thanks for the plugin tho i got a few issues! Looks like the plugin executes my php code and keeps refreshing the page when i include at http://tihid.com/2014/07/08/responsive-contact-form-with-php/
i meant that when i include Sorry about that
Tried to include the pre … script tag that’s causing the trouble but seems it can’t show up here
Pingback: ?? Markdown ?? WordPress ?? | ????
Pingback: WordPress ? GitHub Gist ? Swift | MUSHIKAGO APPS MEMO
Pingback: [M] 2012??! ???????????WordPress?????52? | mbdb (????)
Pingback: ?? Markdown ?? WordPress ?? | ????
Pingback: Wordpress Temas? | Demirpençe
Pingback: ??????? WordPress 2014 - ??????? | ???? ???????? ?????? | ???? ???????? ??????
Pingback: Nice plugin for displaying code snippets in Wordpress |
Hi! I was curious if there any known issues with getting themes to work in WordPress.org (latest release). I’m able to insert code snippets, but I cannot seem to get any of the themes that I change in settings to take effect. I scouted the web for a few days but didn’t see any similar questions raised anywhere about this. The plugins all appear to have been installed correctly as no errors were reported. Any ideas? Thanks!
You aren’t using my plugin on your site. You’re using “auto-syntaxhighlighter”, whatever that is.
My plugin switches themes just fine. I just tested here on my site which is running WordPress 4.0-beta3.
Excellent plugin. Can you add the facility to control the font size of the code?
No plans to do that. It should match the font size of your theme. You can use CSS (with
!important
) to change it though.The syntax highlighter already uses !important, so if I use !important in my custom css it is overridden by Syntax Highlighter.
Right but load order still matters. If you throw a
<style>
tag after yourwp_head()
call, then it’ll override that.Hi There!
I’m trying to load the plugin in one specific page, there is any way that i could do that?
Thanks for this amazing plugin!
What do you mean? Enable the plugin and then use the plugin’s shortcode to display the code. The plugin won’t load it’s JavaScript and stuff unless you use the shortcode, i.e. it won’t load on all other pages.
Pingback: Building a WordPress site in AWS | Fix Computer
Pingback: Web Programming Blog
Pingback: ??????????????????????SyntaxHighlighter Evolved? | WEB KAY NOTEBOOK
Pingback: Kizz MyAnthia » Blog Archive » SyntaxHighliter test
Hi all
please, someone can tell me how to prevent the loading of the style file on the home page?
thanks
There is no reason to remove it. It doesn’t do anything. It is there so that my JavaScript can add CSS after it but it only does that if you use one of my plugin’s shortcodes on that page. There isn’t a good way to determine if you are going to do that in the header which is why I use JavaScript in the footer to add the CSS.
Pingback: Le guid de meilleurs plugins pour Wordpress
Hi Alex
I’ve been running this plugin on my local but I cannot render the themes / css and the numbering..
What is wrong?
The preview on admin area is working but in the page it is not.. It only shows the simple contents.
I already add on footer.
thanks
Aries
What’s the URL to a post on your website where I can see this happening?
Pingback: ????????? ???? — ?????? SyntaxHighlighter Evolved | vseowebe
Pingback: textarea??????????????????p??????????? | wordpress??????
Pingback: Nützliche WordPress Plugins – Teil 2 | PabstWP
Is there any way to configure the plugin so that it loads when the page loads and not after the page loads? When I load a page with code on it… the code comes in regular text and then after the page loads it changes to the formatted text. Is there a way to configure this?
No, the highlighting is done using a JavaScript library rather than on the server via PHP. This is for speed reasons. The JavaScript has to wait for the page to finish loading before it can do it’s thing however.