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.
i have found a Exception :/
PHP Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ‘;’ in Entity, line: 1108 in /wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(26) : eval()’d code on line 3
Pingback: ???????????? | ZZ'BLOG
Pingback: Dashboard graphics with R | NorCalBiostat
Pingback: Hello world! | user's Blog!
Pingback: First post | gdappdelegate
Pingback: ???????????????????? | generative design workshop
how to use html code for? I’m putting is that way?
Pingback: WordPress??????SyntaxHighlighter?????? | foctc.com
Pingback: Adieu SyntaxHighlighter
I have found a Bug.
The Info Cursor scrolls vertical. 😀
It’s not fatal, only trivial, but not realy nice to read the Code.
Pingback: Everyday Microsoft Technology | Sytax Highlighter
Pingback: Test av inlägg med programkod - Genuin IT AB
Pingback: How to: Textarea that can do syntax highlighting on the fly? | SevenNet
Using the default twentyfifteen theme, the gutter with line numbers do not appear in syntaxhighlighter. Changing back to twentytwelve that I had been using before restores this functionality.
I see that someone posted about the issue with twentyfifteen at wordpress.org/support/topic/broken-on-2015-theme
Hi, fab plugin – I’m going through my post history and updating them with the code tags.
Mostly working fine, but on one of my (longer) posts, it’s changing any symbols ( , ” etc) to their HTML code. My other posts are rendering fine – so wonder if there might be something I should look out for in the rest of my post which could be conflicting? Using these symbols in the main body works fine – just not in the text/code blocks. Thanks!
The plugin escapes HTML that is within it’s shortcodes behind the scenes and before it goes into the database so that if the plugin is disabled, the HTML doesn’t suddenly start rendering. However when you go to edit the post, it should reverse the process so that it looks the same within the editor.
Pingback: Menuliskan Baris Perintah dalam WordPress | chaplux
Is the info about customizing themes at http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/adding-a-new-theme/ up to date?
Pingback: 40+ ESSENTIAL WORDPRESS PLUGINS - DostiFun
Pingback: Scripts Linux | SOSpedia punto net
Pingback: Get a site like mine! | Ramblings
Pingback: WordPress??????SyntaxHighlighter?????? | Tan_Jin's Blog
Pingback: Best Wordpress syntax hightlighter plugin: SyntaxHighlighter Evolved - Minh Thang's Blog
Pingback: ?-????? | ?????
Hey. I was using a different one that wasn’t as good. Switched to yours, which is better. However, I have hundreds of posts with many snippets marked as XAML, as I coded in WPF for a long time. Everytime there is an update, I have to edit syntaxhighlighter/syntaxhighlighter.php and manually add this brush alias:
‘xaml’ => ‘xml’,
Do you think you could add that to your brush aliases for next release?
I’m surprised it works because I didn’t think it would as
xaml
is not a recognized alias:https://github.com/Viper007Bond/syntaxhighlighter/blob/3d2ee77a46ce9bfd6c25a95cca84068fa664ce8f/syntaxhighlighter3/scripts/shBrushXml.js#L65
As documented here, you can just add this to your theme’s functions.php file though to avoid editing the plugin:
Pingback: WordPress???? SyntaxHighlighter Evolved – w1100n
Pingback: Formatting in WordPress | Andrew's Blog
Pingback: 25 Syntax Highlighters: Tried and Tested « site design
Pingback: 25 Syntax Highlighters: Tried and Tested - Innovative Studio
Pingback: 25 Syntax Highlighters: Tried and Tested | Web Technologies
Pingback: 25 Syntax Highlighters: Tried and TestedFree Internet Tutorials | Free Internet Tutorials
Pingback: 25 Syntax Highlighters: Tried and Tested | The Web Geek
Pingback: Getting highlighting with SyntaxHighlighter Evolved
Pingback: WordPress??????SyntaxHighlighter????(?) | Welcome
Pingback: Developer's blog | amazon-ec2-using-smart-update-to-wordpress-plugins
Pingback: WordPress??????SyntaxHighlighter????(?) | Welcome
Pingback: ??? ????? ???????????? | ?????????-????-?-??????-??????????????-????????????-?-wordpress-syntaxhighlighter-?-comment-form
Is it possible to have multi-line macros (with lines ending with backslashes) in C?
This isn’t a place for help with programming. Try Stack Overflow instead.
Oops, I think I wrote it badly. I mean to have C multi-line macros correctly highlighted. say
Thanks for the great plugin! It is great!
Ah. If something isn’t highlighting correctly, then you’ll need to report the issue upstream as I’m not the author of the highlighting JavaScript, just the WordPress implementation of it (shortcodes, etc.).
https://github.com/syntaxhighlighter/syntaxhighlighter
Oops, sorry!
Thanks for the information, I’ve reported the bug. =)
Thank you for the the awesome plugin
Hi. Thanks for this nice plugin. I have but one problem with it: how is it possible to use the syntax highlighting within a paragraph? I would like to refer to parts of the code within a sentence and use the same highlighting for that, but I can’t seem to find a way to do that.
It’s not possible using the highlighting package that my plugin uses. Sorry.
Pingback: WordPress blog için gerekli 10 eklenti | KirmiziKit :d
Thanks Alex, this is plugin help me when write code in wordpress post. Thank you again.
//My english is bad
Great plugin! What would like is that the syntax for all code tags is left aligned except for de txt-tag. The syntax for de txt-tag has to be centered. Is that possible? I have experimented a bit with the class but can not get done this.
Pingback: ?????????? ???????????? ????? — ??????? 1 | Seo-New
Pingback: Test… SyntaxHighlighter
Awesome, it works really great!
Pingback: Incrustar “gists” de github en WordPress
Is there anything special do enable toolbar in wordpress 4.3? I’ve enabled in settings, but doesn’t work, never show toolbar (print, copu code, etc…).
Those were only needed in the old version of the highlighting library because when you used to highlight the code with your mouse, it would also include the line numbers. In the latest version which my plugin uses, you can copy the code just like you would any other text.
However if you want to switch back to the older version of the library, you can do so from the top of this plugin’s settings page. Due to a security issue though, the copy to clipboard button will not work. It required a Flash file to work and the file had security issues so I was forced to remove it.
Pingback: SyntaxHighlighter Evolved | WP Plugin Directory