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.
[php htmlscript=”true” highlight=”12″]<!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>[/php]
If you prefer, you can hide the line numbering and other UI stuff with the “light” mode, for example:
[code light=”1″][[php light="true"]your code here[/php]][/code]
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.
Hello Bond!!!
The package 3.1.1 do not include localization pt-BR files?
Thanks!!!
Vinny
Pingback: Wordpress Syntax Highlighting « « babblative.com babblative.com
Hello,
When I show single.php pages the code is´n formatted, , but index.php.
just for discard I’ve copied all the index.php code in single.php…
surprise!
same php code has Highlight effect when render using index.php but single.php.
Why this is happen?
What can I do?
Debugging, I get this when same code run on single.php
“SCRIPT5022: DOM Exception: NOT_FOUND_ERR (8) ”
[code]
document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") )
[/code]
Resolved!
for some reasons my theme had in the header something like
[code] <?php if ( is_single() ) { ?> plain text <?php } ?> [/code]
Pingback: WordPress3.1??????????????plugin×17 | b-log
Hey,
Any one know why my post with quotes has the quotes showing up with " instead of a quote sign:
See it here:
http://www.rhyous.com/2010/12/03/freebsd-wireless-configuring-a-wireless-interface-on-freebsd-8-1/#comment-1967
I have it wrapped as follows:
[shell]
network={
ssid="PrimarySSID"
psk="Password1"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
}
[/shell]
Pingback: My Favourite Wordpress Plugins - babblative.com ›
Pingback: WordPress | ingegno.it
Pingback: ?????? syntaxhighlighter ?????????? | ????????
Pingback: Last Ray of Hope » Syntax Highlighting
Pingback: wordpress???? | ????
Is there a maximum vertical size variable somewhere to be set? I would like to put a 400-line code block on my blog without literally taking up 400 lines.
Also, I note that all code-blocks have vertical scroll bars in Chrome… looks like something is rendering 1-pixel too tall.
Finally, is there a command line CSS? Would require little if any color with grey text on a black-ish background? Would be helpful when showing command-line examples.
Really have to say thanks though, as no matter what, this is definitely the best highlighter out there.
Pingback: Tutorial: Adding XAML To A Wordpress Post
Thanks Alex for the gold standard WP code plug-in. It’s just great.
Pingback: ????? ????????? ???????? ?? ???????? « Sauyd's Blog
All,
I’ve tried everything and can’t seem to get this plugin to work correctly or any syntax highlighter for that matter. I’ve tried disabling all other pluigns on my site and even tried variations of the short codes. Does anyone have any thoughts as to why this isn’t working properly? http://www.adamestrada.net/2009/06/13/georss-from-c/ that is a page that it fails on. Your insight in to this is greatly appreciated…
Adam
Your code are highlighted just fine: http://img203.imageshack.us/img203/1353/syntax.gif. Have you tried http://wordpress.org/extend/plugins/better-wordpress-syntax-based-on-geshi/ or http://wordpress.org/extend/plugins/wp-syntax/? They both work for me.
and btw your code contains some wrongly placed quotes (line 3, for example).
hello viper,
SyntaxHighlighter not working on myblog,
cek this link, http://ubuntuportal.com/2011/how-to-install-libreoffce-on-ubuntu-10-04-10-10-and-11-04/
when I use safari browser code appear on my blog, if use chrome and firefox code not appear, please help me
Pingback: Der Fahrplan | HTML5-Blog
Pingback: Wordpress + source code + LaTeX |
Did you ever look into http://code.google.com/p/google-code-prettify/ ? This would be nice as an option to have within your plugin to either use 2/3 syntaxhighlighter, or the google-code-prettify.
Pingback: 21 Awesome Wordpress Plugins :Raised By Turtles
Pingback: WordPress???????????????? ?SyntaxHighlighter Evolved? ??? « DTP??????WEB????????????? ???????????
I’m getting vertical scroll bars in all of my code blocks since the last version. The problem doesn’t seem to affect IE or firefox, but it does seem to occur in Opera and Chrome.
I too am seeing vertical scrollbars on all blocks in Chrome, both on my own site and even on this site! Alex – do you have an update on a fix for this please?
Pingback: Plugin collection « nealfive.de
Pingback: SyntaxHighlighter Evolved Review – Best Wordpress Plugins
Pingback: END[SEVEN] Web Development » Guess what? I updated my blog!
I’m trying to add this on to my blog, and have attempted with the default theme and only this plugin running. It generally works well, but I’ve found that I can’t have a php include in the code. If I do so, even if it is not referencing a file, it will not save the post, but instead take me to a 404 page. For the moment I am misspelling the word include, and it is displaying with the misspelling. I haven’t seen anyone post about this yet, and was curious if there was a fix for it.
Thanks!
That sounds like some type of lame security being implemented by your host. If you disable my plugin, I bet you get the same issue.
I’m not really sure how I’d go about testing it, though yes, I cannot show them within code tags in any way.
Your host is likely blocking the POST thinking it’s a hacking attempt.
I think you need to find a better host if they won’t provide support for something that is clearly not a third party application issue.
By the way, if you happen to follow this kind of thing, this is what would constitute a regular response from my host:
“There are no issues with the server settings and all the settings is related with that particular application/software. We cannot provide such support as it is a third party application.
Please let us know if anything needs to be changed at the server end .”
Pingback: Librisbloggen » Hur vi använder Wordpress
Pingback: Google is translating my code! | Tinsology
Pingback: » Source Code in Wordpress Linux Sagas
Hi, Alex. I’m sorry to bother you. Any chance of helping me with this issue: http://wordpress.org/support/topic/syntaxhighlighter-evolved-and-qtranslate-integration?
Thanks!
Best regards,
Daniel.
XmlDocument has no color, why?
Pingback: ?????? - WordPress?SyntaxHighlighter Evolved???????
I always add this line
‘xaml’ => ‘xml’,
You might ask why I didn’t just tag them with xml, well, I used a different syntax highligher for a while that had the xaml option, so I have to because I am a lot of posts already tagged as follows:
[code][xaml]
<Page>…
[/xaml][/code]
Smile,
Jared
Rather than editing my plugin, add this to your own plugin or your theme’s
functions.phpfile:[php]add_filter( ‘syntaxhighlighter_brushes’, ‘syntaxhighlighter_add_xaml_alias’ );
function syntaxhighlighter_add_xaml_alias( $brushes ) {
$brushes[‘xaml’] = ‘xml’;
return $brushes;
}[/php]
Pingback: Webridge?WordPress???????? | WeBridge
Pingback: ???????? 10-?? ???????? ??? Wordpress | ???? ?????????
Pingback: Wordpress Plugins | webmanufaktur.org
Pingback: ????????? ???? ??????????? SyntaxHighlighter Plus |
Pingback: Anonymous
If you are searching for a code highlighting textarea component without any dependencies on the WordPress system, just go with the open-source EditArea component available at http://www.cdolivet.com/index.php?page=editArea
a most curious occurence. try to display the following as php code using your plugin:
[code]<?php do_shortcode(‘[gallery]‘); ?>[/code]
it’s a do_shortcode instruction, wrapped in opening and closing php tags, to invoke a shortcode called gallery. the name of the shortcode (gallery) disappears!!!
yet I have seen that instruction displayed properly on wprecipes.com!!!
(This is happening with V3.1.1 in 2.x or 3.x mode, on WP 3.1.2 in Local as well as online)
This is because the shortcode handler for
gallerycomes along later and tries to replace it with the actual gallery. Nothing I can do about it really. 🙁Great plug-in!
Is there a way to set a fixed height and use vertical a vertical scrollbar? My code is quite big and I don’t feel like make it collapseable…
Pingback: ??Syntax Highlighter?Haskell???? | ArieShout ???
Pingback: Publicando código fonte com Wordpress | Rafael de Meira Teixeira
Pingback: END[SEVEN] Web Development » How fast do your WordPress pages load?
Hi alex, how can I styling this plugin using CSS, for example I want the post font-size 14px, but I want the code snippet still 12px, thanks
Pingback: SyntaxHighlighter Evolved: Haskell Brush | Código Fantasma
Pingback: Code markup plugin | Bitter Blog
Pingback: ??Syntax Highlighter?Haskell???? | ArieShout ???