Seeking code highlighter recommendation for WordPress

Code highlighter recommendation

Can anybody recommend a reliable and decently documented code highlighter for WordPress 2.6.1? I have tried Code Snippet by Roman Roan and Developer Formatter by Gilberto Saraiva. But they don't seem to work as described in the documentation and are mangling the code snippets instead of prettifying them.

Re-opened...OP is asking about a 'code highlighter' widget...something programmers use on their blogs...seems programming related to me.

5 Answers

I use WP-Syntax and it's worked very well for me. It's supported every language I've thrown at it so far, and the colors can be customized for a particular theme (though the defaults look just fine too)

Initially, I also used this plugin. Its simplicity and the fact that it is based on a well-established library (GeSHi) are the main arguments. I noticed, however, that it does not make best use of WordPress and GeSHi, and that it was not actively developed anymore. Therefore, I started some kind of rewrite back in 2010, with good intentions in mind. It is available as wordpress plugin: wp-geshi-highlight.

You should also checkout syntaxhighlighter from Google Code.

I use the GeSHi Syntax Highlighter Plugin in my blog and I find it works well. Which highlighter you use tends to depend on which languages you use most frequently and how good the support is for them.

I forgot that GeSHi is the highlighter associated with the Wordpress SyntaxHighlighter plugin. :/

The plugin you mentioned uses the "SyntaxHighlighter JavaScript package by Alex Gorbatchev."

WP-Syntax uses GeSHi to do the highlighting, the WordPress Syntax Highlighter uses the Javascript SyntaxHighlighter

wordpress plugin wp-synhighlight

It utilizes shordcodes and works well in GUI editor also unlike some others (WP-Syntax has some problems with GUI).

WP-Syntax

WP-Syntax provides clean syntax highlighting using GeSHi — supporting a wide range of popular languages. It supports highlighting with or without line numbers and maintains formatting while copying snippets of code from the browser.

It avoids conflicts with other 3rd party plugins by running an early pre-filter and a late post-filter that substitutes and pulls the code snippets out first and then pushes them back in with highlighting at the end. The result is source code formatted and highlighted the way you intended.

WP-GeSHi-Highlight

WP-GeSHi-Highlight works as a drop-in replacement for WP-Syntax, which does not seem to be maintained anymore (as of 2015).

SyntaxHighlighter Evolved

SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without losing its formatting or making any manual changes. It uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev.

WP-SynHighlight

Plugin provides syntax highlighting in posts and comments. Full GUI mode. No need to switch to code mode and back like in some other plugins. GUI editor with realtime syntax highligting support integrated (can be disable in settings). GUI button to help with highlighting options. No need to memorize them! Blog-wide default settings for code highlighting. Now you can change the look of all your posts at once! Many options to customize code highlighting (almost full Geshi set).

SyntaxHighlighter

SyntaxHighlighter is here to help a developer/coder to post code snippets online with ease and have it look pretty. It's 100% JavaScript based and it doesn't care what you have on your server. SyntaxHighlighter uses regular expressions to parse the text. It's not extremely fast, in fact, it's pretty slow. If you are trying to highlight a few dozens lines of code, you won't see any problems. Trying to highlight 10kb worth of text will result in JavaScript being aborted because of long execution time.

GeSHi - Generic Syntax Highlighter

GeSHi is exactly what the acronym stands for: a Generic Syntax Highlighter. As long as you have a language file for almost any computer language - whether it be a scripting language, object orientated, markup or anything in between - GeSHi can highlight it! GeSHi is extremely customisable - the same source can be highlighted multiple times in multiple ways - the same source even with a different language. GeSHi outputs XHTML strict compliant code1, and can make use of CSS to save on the amount of output. And what is the cost for all of this? You need PHP.

Here are some of the standout features of GeSHi:

Programmed in PHP: GeSHi is coded entirely in PHP. This means that where ever you have PHP, you can have GeSHi! Almost any free webhost supports PHP, and GeSHi works fine with PHP > 4.3.02.

Support for many languages: GeSHi comes with more than 100 languages, including PHP, HTML, CSS, Java, C, Lisp, XML, Perl, Python, ASM and many more!

XHTML compliant output: GeSHi produces XHTML compliant output, using stylesheets, so you need not worry about GeSHi ruining your claims to perfection in the standards department ;)

Highly customisable: GeSHi allows you to change the style of the output on the fly, use CSS classes or not, use an external stylesheet or not, use line numbering, change the case of output keywords… the list goes on and on!

Flexible: Unfortunately, GeSHi is quite load/time intensive for large blocks of code. However, you want speed? Turn off any features you don’t like, pre-make a stylesheet and use CSS classes to reduce the amount of output and more - it’s easy to strike a balance that suits you.

WordPress MediaWiki integration

WordPress and MediaWiki

On the other end of the spectrum, I would be happy if I could install a wiki and share the login credentials between WordPress and the wiki. I hacked MediaWiki a while ago to share logins with another site (in ASP Classic) via session cookies, and it was a pain to do and even worse to maintain. Ideally, I would like to find a plug-in or someone who knows a more elegant solution. 6 Answers The tutorial WordPress, bbPress & MediaWiki should get you on the right track to integrating MediaWiki into your WordPress install. It's certainly going to be a lot easier than hacking WordPress to have wiki features, especially with the sort of granular permissions you're describing. The link in this answer is broken. After a bit of googling I'm pretty sure that this is the page that the link was supposed to point Updated link Both MediaWiki and Wordpress support OpenID Though, I think for automatic logins (after you log in to one, you…

Read more…

How do I list all Entries with a certain tag in Wordpress? | widget

widget: list all entries with a certain tag

I may just be missing this functionality, but does anyone know if there is a widget available: I need to list the subject for all the entries that are associated with a given tag. For example: I have 5 articles tagged with "Tutorial", I'd like to see a list as follows: Tutorial 1: Installing the app Tutorial 2: Customizing Tutorial 3: Advanced edits Tutorial 4: User managment Does functionality like this exists in wordpress allready? 3 Answers If you are comfortable with hacking WP you can try adding to your sidebar with wp_list_pages. Or there are plug-ins like Simple-Tags that help you manage your tags. The nice thing about WordPress is there…

Read more…

How to select posts with specific tags, categories in WordPress | SQL

Select posts with tags/categories in WordPress

This is a very specific question regarding MySQL as implemented in WordPress . I'm trying to develop a plugin that will show (select) posts that have specific 'tags' and belong to specific 'categories' (both multiple) I was told it's impossible because of the way categories and tags are stored: wp_posts contains a list of posts, each post have an "ID" wp_terms contains a list of terms (both categories and tags). Each term has a TERM_ID wp_term_taxonomy has a list of terms with…

Read more…