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.
Pingback: WordPress???????SyntaxHighlighter Evolved | ??
Pingback: init() | Random Segments of Code
very nice plugin thank you! will definitely use it on my blog.
Pingback: Incrustar “gists” de github en WordPress | Tecnologia, Desarrollo Web, Posicionamiento Web SEO
When I use the title=”” attribute, it is mangled after I click Save. An example:
[vb title="Endless program written in BASIC"][/vb]Comes out as
[vb title="Endless 1=in 2=BASIC"][/vb]Any ideas?
I’m experiencing the same exact thing after updating to the latest version of the plugin.
Hmm, that’s not good. I’ll check it out.
Pingback: andAsk??????????????????????????? | andAsk.net
Pingback: Tuszynek » Innowacje dla ??dnych mody
Pingback: wordpress??????? | IT????_itblood.com
Pingback: The Top 100 WordPress Plugins For Your Site | Free WordPress Tutorials Site
I have an issue, that is many white line added before my scripts.
You can see at http://techblog.vn/lap-trinh-vien/php-gui-sms-brandname-1sms-vn-958/
Please tell my why and how to fix.
Thanks and best regards.
If you’re sure it’s not like that in the post editor, then try disabling some other plugins. One of them must be causing the issue.
Pingback: SyntaxHighlighter Evolved – ?????????? | ???
Pingback: Google Syntax Highlighter: Wordpress TinyMCE strips out HTML tags and attributes as Author | rob mills
Pingback: Blog Basics » Mike's Research Blog
Its a nice work,many many thanks.But I think it has one issue,a suicidal daring act.Putting dangerous code with encoding html entities.And let the plugin do automatic formatting.
Say if some how this plugin ceased to work,or in future it might not supported by wordpress,or you might to move on a better option-but all the codes are published without formatting.
My question is how to disable this auto formatting that is html entities encoding,I like to publish encode code myself. Again thanks for this great work.
The plugin stores the code encoded. If you disable the plugin, then nothing bad will happen.
Hello, can you tell me how best to hardcode this into a theme? I’ve tried using (checked ‘load all brushes’) along with several others with no success.
Thank you!
This would be best:
[sourcecode lang=”php”]<?php echo apply_filters( ‘the_content’, ‘[code]foobar[/code]’ ); ?>[/sourcecode]
Pingback: Essential Plugins for Wordpress Blog : Codefap.com
Pingback: 10 Essential Wordpress Plugins : Codefap.com
Pingback: Hello World – Syntax Highlighter in Wordpress | HunterGerlach.com
Pingback: Los Mejores Plugins de WordPress para Tu Sitio Web (2a parte) | Blog Diseño Web
Pingback: highlight.js – Syntax Highlighting in Wordpress ohne Plugin | Mario Fink
Hello, I’ve installed the plugin but it doesn’t work on my current theme and I couldn’t find out the reason. Can you please help me on it?!
oops! My theme footer hadn’t code below:
[code lang=”php”]<?php wp_footer(); ?>[/code]
Thanks for your amazing plugin!
Yep, that’s a required theme hook. 🙂
Glad you got it sorted out.
Nice plugin, I’ve been using it for a while on wordpress.com. When I use it on wordpress.org, the lines are never wrapped though. What can I do to wrap them? This is my tag, for instance:
[sourcecode language=”text” light=”true”][/sourcecode]
Sounds like a CSS issue maybe with your theme. Try temporarily switching to the default theme.
Pingback: wordpress??????SyntaxHighlighter Evolved | Jack Blog
Pingback: Wordpress ?çin Gerekli Eklentiler | Ali Ayaz
Hi Viper, do you know how I can add padding to the left of the code box, because when I’m not using line numbers there’s no padding at all, and it looks strange! See http://www.luigip.com/?p=82
I’ve changed some of the attributes in the cssCore.css file (which is how I got the inset shadow and rounded corners), but adding padding in the `.syntaxhighlighter textarea {` section puts padding around all elements, in the middle of the code. (Editing the cssCoreDefault.css file doesn’t seem to do anything at all.) Any ideas?
(BTW you might like to try the Akismet plugin to stop all the spam comments here. It works for me!)
You’re kind of on your own for customizing it — I didn’t write the highlighter and don’t know the CSS that well.
As for Akismet, I’m already running that. No spam comments here, although some of the pingbacks might be sketchy. Many are also legitimate though.
Pingback: INFERLab Site
Pingback: Página Web del INFER Lab
Pingback: Nos actualizamos | Mis Cososas
Pingback: SyntaxHighlighter — ????????? ???? ?? WP | Udobnosti.ru
WOW amazing plugin, I also featured this plugin in my site.
Pingback: ???? » wordpress ????
Pingback: Posting Source Code di WordPress | aryadkp
Great plugin..
but very complicated to add your own brush, I found one for apacheconf/htaccess here : https://gist.github.com/1048123
Maybe you could add it to your next release 🙂
“Very complicated”? It’s super simple. I even wrote a guide: https://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/adding-a-new-brush-language/
Pingback: WordPress blog için gerekli 10 eklenti | Sekizncihayat Blog | Freelance Yaz?l?m Hizmetleri
Pingback: O muzyce i O Wszystkim » Japan Stylenowoczesny trend w modzie kobiecej
Pingback: Infinite Scroll and SyntaxHighlighter Evolved | Matt Shelton
Pingback: ???????????? | R*d@weblog
Pingback: En Popüler Wordpress Eklentileri ve WordPress Eklenti Yükleme | Dünya'dan Ve Türkiye'den 10 Haberleri
I just installed the very latest WP 3.4.1, brand-new install. Having trouble with SHE, though. If I publish a new post with [cpp][/cpp], it just discards everything between shortcodes and leaves the shortcodes there.
Nevermind. I’m pretty sure this is due to problems in the Quercus (Caucho’s PHP implementation) container.
Pingback: First Wordpress Plugin: wp-markdown-syntaxhighlighter | Matt Shelton
Pingback: Perl Test-Driven Development: Set Up Your Test Environment | The Strong Family Association of America, Inc.
Pingback: ????????? | ??????
Pingback: Perl Test-Driven Development: Set Up Your Test Environment | Genealogy Webmaster's Journal
Pingback: Infinite Scroll and SyntaxHighlighter Evolved | Matt Shelton
Pingback: First Wordpress Plugin: wp-markdown-syntaxhighlighter | Matt Shelton
Pingback: ????????????????????????WordPress?????10? | kwLog
Pingback: WP-Markdown-SyntaxHighlighter - India IT Directory Top Software Development Companies in India
Pingback: WordPress SyntaxHighlighter Evolved ??????????????? - ????
Pingback: ?????????????????|SyntaxHighlighter Evolved | MNT
Pingback: [Wordpress]TekTea’s Blog????????SyntaxHighlighter Evolved | TekTea's Blog