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: 3 Syntax Highlighter Plugin per Wordpress - Adostudio
Pingback: Posting Source Code di WordPress « Web Development Labs
Hi!
Can you help me, in readme.txt don’t have any mention to font size, is very very small in my installation…
In your example (upside) font size is normal, why…?
The code inherits its font size from your theme. It should be the same size as the text in your posts. If it’s not, then it must be something in your theme’s
style.css.Pingback: Escribir código en Wordpress | Memorias de un aprendiz
Pingback: Plugin - SyntaxHighlighter Evolved | Treze Droid
Pingback: QuestioVerbum.org » Blog Archive » New Plugins Added - Seeking The Word and Truth Through Literature and Theology
Pingback: wordoress???10????????? | PHP10086???
Pingback: ?Blog???wordpress | Euclidvi31's Blog
> TIP: Don’t use the Visual editor if you don’t want your code mangled.
> TinyMCE will “clean up” your HTML.
[code]<pre> … </pre>[/code]
And then nothing more is removed from TinyMCE.
But now you have to remove the , when displayed.
Is planned for sometime a direct integration of an insert buttons in TinyMCE?
[ code] … [/code ]
[ code] … [/code ]
Sometimes it is not easy with this code tags.
I enabled the SyntaxHighlighter plug-in, WordPress default editor can not load button, this is why? Referrals to help
Pingback: WordPress??????????????? | ?????????
Pingback: Markdown??????????????? | Ginpen.com
I’m using Genesis child theme, now Syntax highlighter not working, just output is code inside box.
Pingback: ??????????????????????????????????SyntaxHighlighter Evolved? | WordPress ?????? ??
Pingback: ??????????????????????????????????SyntaxHighlighter Evolved? | WordPress ?????? ??
Pingback: ??????????????????????????????????SyntaxHighlighter Evolved? | WordPress ?????? ??
Pingback: Syntax Highlighting in WordPress | Mr.Fish Studios
Hi,
Is there any chance that you can make the code block expand on mouse over? (currently, on mouse over the toolbar is displayed).
Thanks,
DM
I’m not the author of the Javascript package, just the WordPress implementation of it (shortcodes, properly handling encoding, etc.).
You’ll want to submit feature requests upstream: http://alexgorbatchev.com/SyntaxHighlighter/
Pingback: Code highlighter: expand on mouse over - Colorblind Programming
Pingback: WordPress?????????????????? @ ????WEB?????
Pingback: SyntaxHighlighter | ?????
Pingback: ??????????????(Wordpress?Template??) | ?????????? ?????????(?)
Pingback: WP SyntaxHighlighter ?????1.7.1 | ?????
How do you create a custom theme so it shows in the theme dropdown?
See http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/adding-a-new-theme/
I have been searching for a good plugin, and this looks very nice! I will try it and most likely use it on my own website!
thanks!
Hi, I have testing SyntaxHighlighter and noticed that if you turn off line numbering and then save the settings then if you try to turn line numbering back on then it does not work, in order to get the line numbers back you have to load the defaults. Also I have seen this plugin being used were by each line of code has an alternative coloured background for ease of reading, how can I get that effect to work with your plugin ? It would be nice if when users cut & paste the code that the line numbers were not included. Also if line numbers were turned off it would still be nice to keep the green verticle line but unfortunately it disappears. Any pointers would be really appreciated.
I’ll investigate the line number setting issue.
I believe that was a feature of v2.x of the highlighter. You can switch to it from the settings page.
That is one of the features of v3.x of the highlighter. Try it at the top of this page — the line numbers shouldn’t be selected when you select the code.
The green bar is just there as a divider between the code and the line numbers. It’s not needed if you don’t have line numbers.
You could add a left border using CSS though.
Pingback: ???????? | toemon's Blog Site
Pingback: Wordpress First Steps « ingegno.it
Dear Sir,
I’m using your SyntaxHighlighter plugin, but when I try to use the methods shown on the settings page for dispalying the block of code I want to highlight it gives me the wrong code.
if you go here: http://tutorials.mysitemyway.com/adding-versatile-button-shortcodes-to-your-wordpress-theme/
and scroll to the bottom of the page you’ll see your plugin in action.
If you go to my page: http://timothycaron.com/button-shortcodes/
You’ll see something entirely different: It’s actually displaying the HTML the shortcode produces and not this:
[button link=”#” variation=”teal” size=”large”]Your Text[/button]
[button link=”#” variation=”teal”]Your Text[/button]
Can you help point me in the right direction?
Thanks
Tim
If you want to display shortcodes and not render them, then you need to escape them.
See http://www.viper007bond.com/2011/08/13/displaying-shortcodes/
i.e. do this:
[[button link="#" variation="teal" size="large"]Your Text[/button]]Dear Alex,
Duh? what was I thinking? Thank you so much for the reminder, must have been very tired.
Thanks again
Tim
Hi,
I’m using SyntaxHighliter for wordpress, but I found that it didn’t work in my own theme. I put the [php][/php] around the code, and it works well in the default theme “twentyeleven”. But if the theme is switched to the one I made, the code won’t be highlighted anymore.
I’ve checked the page element, it is:
[code]<pre class="brush: php; title: ; notranslate" title>code here</pre>[/code]
But the code between is just like the words anywhere else.
So is there anything I need to do in my theme in order to make it work?
Thanks
Melkor
You’re missing a required theme hook that every theme should have.
http://wordpress.org/extend/plugins/syntaxhighlighter/faq/
Yeah I got it, thanks a lot!! I’m just a rookie at making a theme…
Pingback: ????????????????????? | Nulab Tech Blog
Pingback: 30 Most Important WordPress Plugins | Phire Base - Graphic, Webdesign, Inspiration. Adobe & WP
Pingback: T?? ? Techpot » Blog Archive » wordpress?????
Pingback: ????????? ???? - ?????? SyntaxHighlighter Evolved | ??? ? WEB ????????????????
I currently use “code highlighter” wordpress plugin but want to move over to syntaxhighlighter for the extra functionality. The one things thats preventing me so far is the ability to limit the size of code boxes.
If i want to post 100 lines of code i obviously wouldn’t want all that displayed, instead maybe a scrollable box that only displays 15 lines of code for example.
Currently i use the following code on my code highlighter plugin:
[code] overflow: auto; max-height: 200px;[/code]
How can i add this to syntaxhighlighter?
P.s. I’m aware of the collapse code option but i would like show some of the code rather than none.
Cheers
Add
!importantto your CSS declarations.Thanks for the reply, im not entirely sure what you mean. Do you mean add this to my style.css? Where do i need to add it?
Thanks
P.s. Sorry for the lack of wordpress/css/php knowledge
Yes, adding it to your
style.csswith the correct classes (.syntaxhighlighterif I remember correctly) and!importantmay do the trick. I’m not sure, you’ll need to fiddle with it.How to make a toolbar in the screenshot?
http://u.to/tyR8AQ
That is from “Version 2.x”. You can switch to it from the Settings page (Settings -> SyntaxHighlighter).
“Version 3.x” doesn’t need it though because you can just highlight it with your mouse and copy/paste without getting line numbers.
Pingback: Exec-PHP?SyntaxHighlighter????????? | Birds in Code
Pingback: ????Wordpress?????????10? | ninjatokyo.com
Why don’t you have any examples of how to use the plugin on this page?
Because it’s documented on the bottom of the plugin’s Settings page and I also link to documentation that I have written over on WordPress.com.
I’m currently working on a redesign of our blog. I bought the dynamix theme from themeforest. Now all pre tags are not rendered correctly anymore. Any ideas how I can overcome this issue?
http://www.redesign.planetgeek.ch (top most post for example)
Thanks
Hy Alex
Just wanted to inform you that I solved the issue. It was interference with the W3 Cache plugin. I disabled the w3 Cache plugin and now it works.
Daniel
Great script.Is it compatible with Canvas Woo Theme?
Thanks!
Pingback: Adding a custom PowerCLI brush for syntax highlighting on Wordpress | www.vExperienced.co.uk
Hi Alex!… I found something with SyntaxHighlighter Evolved plugin for WordPress, i don’t know it bug or not please check http://www.all-info4you.com/2012/02/24/syntaxhighlighter-evolved-versi-3-1-3-wordpress-versi-3-3-1-bug-not/. it’s Indonesian you can translate it.
Pingback: [Wordpress] Plugin para mostrar códigos fuente
Pingback: Plugins WordPress
Pingback: Plugins WordPress | Dicasrc | Informática
Pingback: Plugins WordPress | Portal Upideia
Pingback: WordPress SyntaxHighlighter font size fix | Zend Framework University
Pingback: Stefan Ledin - webbutvecklare
Pingback: PG??(WP)