WordPress Plugin – FV Code Highlighter

The main subject of this blog will be web development and feature some interesting articles and tutorials ranging from PHP and jQuery to HTML and CSS. The problem I was facing when I built this theme was the lack of awesome code highlight plugin. I just couldn’t find one that was working for me.

FV Code Highlighter Example
FV Code Highlight Example

I thought maybe more people were looking for a plugin that simply publish codes that looks great. I started to write my own, and the FV Code Highlight plugin was born and now open for the public. The features are plain and simple, read on.

Description

This plugin supports the highlighting of PHP, HTML, CSS and XML. The default tag-highlighter color scheme uses the same colors Adobe’s Dreamweaver is using. This makes it easy for your visitors to recognize what type of codes you wrote. These colors can be changed to your liking in the WPadmin section of your blog.

Features

  • Easy to use
  • Renders XHTML, CSS, XML and PHP (in parts)
  • Default look: Dreamweaver style
  • Customizable look of codes and code box

How to use this plugin?

1. Upload the folder `fv-code-highlighter` to the `/wp-content/plugins/` directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Place in your pages to use the highlighter

Example

CSS Code

/* Comment */
@import url("main.css");
h3, .head2 {
    font-family: "Sans-Serif";
    font-weight: bold;
    color: #336699 !important;
}
@media screen, print {
    pre { margin: 0px 10px 10px; }
    h1 { font-size: 14px; padding-top: 10px; }
}

(x)HTML Code

<style type="text/css">  headline {font-size: 24pt;}  </style>
<!-- Comment -->
<td><a href="link">Plain Text &nbsp;</a>
<img src="image" alt="" width="15" />
<form action="action.pl"> <input type="submit" value="Press Me" />
</form>Text</td>

Plugin Info

AUTHOR: Frank Verhoeven
AUTHOR URL: http://www.frank-verhoeven.com/
WORDPRESS VERSION: 2.5+
TESTED UP TO: 2.6.2
CURRENT VERSION: 1.0

Download

DEMO: Live Demo
DOWNLOAD: FV Code Highlighter, Mirror

Tagged: , .

80 Responses

  1. Stefan Vervoort Says:
    September 13th, 2008 at 1:18 am

    Awesome plugin my friend! Use it all the time.

  2. Frank Verhoeven Says:
    September 14th, 2008 at 1:13 pm

    Thanks, and thanks again for all your help and support!!

  3. bighead Says:
    September 15th, 2008 at 7:12 pm

    Hi, ur plugin is very nice, i am using it…but this version still not support JAVA. Anyway, i have modify it so that it able to format some simple JAVA code. I am wating for ur next release, hope that coming release ll include JAVA formating.Thanks ya, nice job!

  4. Frank Verhoeven Says:
    September 15th, 2008 at 8:55 pm

    Hey bighead,
    Thanks for the compliment!

    At this moment I don’t know much about Java, but I will try to get it implemented in the next release.

  5. tmax Says:
    September 17th, 2008 at 8:10 am

    Thank you for a great plugin Frank! :-)

    I got an error I wanted to run by you in case it is a bug. Of course it might just be my fault instead.

    When I use the

    code

    on a code segment it all works well.
    When I use the

    code

    on a code segment I get the error while the blog post is rendering:

    Fatal error: Call to undefined function: htmlspecialchars_decode() in /home/itrating/public_html/wp-content/plugins/fv-code-highlighter/phpHighlighter.php on line 19

    My WordPress engine is version 2.6.1

    Thanks

  6. Frank Verhoeven Says:
    September 17th, 2008 at 8:51 am

    tmax, thanks!

    I guess you’re running PHP 4, since this function only works on 5.1 and up. However, the problem can be fixed!

    Open the file phpHighlighter.php with notepad or your favorite text editor (it’s in the fv-code-highlighter directory), and search for the next line:

    <?php
    $code = htmlspecialchars_decode($code, ENT_QUOTES);
    ?>
    

    It should be line number 19.

    Now replace that line with this line:

    $code = html_entity_decode($code, ENT_QUOTES, 'utf-8');
    

    And everything should work perfect! :-)

    In the next release this problem will be automatically fixed, since it will get a better PHP highlighter.

  7. tmax Says:
    September 17th, 2008 at 9:01 pm

    Thank you Frank! :-)
    I tried exactly what you said. I now get the following error:
    “Warning: cannot yet handle MBCS in html_entity_decode()! in /home/itrating/public_html/wp-content/plugins/fv-code-highlighter/phpHighlighter.php on line 19″

    Since you mentioned that this will get fixed in the next version I am happy to wait until that comes out instead of pestering you with this, though.

    Thank you for the great plugin! :-)

  8. Frank Verhoeven Says:
    September 17th, 2008 at 9:23 pm

    Too bad it didn’t help you :-(

    I hope to get version 1.1 ready within three weeks.

  9. Crane Machine Says:
    September 21st, 2008 at 3:45 pm

    Very Good~!!

  10. matt Says:
    October 2nd, 2008 at 3:24 am

    plug-in isn’t working for me – I’m running wp 2.6.2

    I inserted the code

     my code here 

    but it just displays as plain text. This is within an actual blog post. Is this plugin only for pages? thanks

  11. Frank Verhoeven Says:
    October 2nd, 2008 at 11:07 am

    It should work both in pages and posts, be sure to use the right syntax as described above and download the latest version. If that still doesn’t work, please send me an email with your server details, so I am able to find the problem.

  12. Lee Says:
    October 4th, 2008 at 5:52 am

    Another satisfied customer! Works great.

  13. 10 Un-Usual Wordpress Plugins that Improved my Blog » DivitoDesign Says:
    October 26th, 2008 at 5:22 pm

    [...] FV Code Highlighter – If you want to highlight code tags like HTML, CSS, PHP or JavaScript on your WordPress blog you [...]

  14. WALO Says:
    October 29th, 2008 at 5:39 pm

    hi!
    i can’t use the plugin i have it active but i place the

    
    

    and i can see the { code} and nothing higlighted
    what am i doing wrong?

  15. Frank Verhoeven Says:
    October 29th, 2008 at 9:44 pm

    Hey,
    You need to remove the = between code and type. So it becomes {code type=php}.

  16. Four Top Wordpress Code Highlighters Reviewed Says:
    November 16th, 2008 at 1:44 am

    [...] FV Code Highlighter [...]

  17. abnfire Says:
    November 24th, 2008 at 12:30 am

    how can i put javascript theme in this, now days its more javascript then html.. can we have javascript option too please..

  18. Frank Verhoeven Says:
    November 24th, 2008 at 4:22 pm

    As soon as PHP is fixed (it now still has some bugs), I can easily add JavaScript support very easy. So it will come soon :-)

  19. Andri yarusman Says:
    November 29th, 2008 at 12:16 pm

    Wow… thanks God ! I found You Franks… FV COde Highlighter it’s So helpfull :)

  20. ThunderWolf Says:
    December 12th, 2008 at 3:17 pm

    GREAT PLUGIN!

  21. Eligio Says:
    February 10th, 2009 at 3:56 am

    great plugin, work perfectly on wordpress 2.7. thanks

  22. « Wordpress Plugin: FV Code Highlighter - Eligio : EH-Lee-Hee-Oh Says:
    February 10th, 2009 at 4:34 am

    [...] FV Code Highlighter works very similar to most the other syntax highlighting scripts, but I like how the plugin use the default dreamweaver tag color and the background color. [...]

  23. Plugin FV Code Highlighter | Webseiten-Infos.de Says:
    February 11th, 2009 at 4:19 pm

    [...] Auswahl war groß. Ich wählte dann das WordPress-Plugin FV Code Highlighter von Frank Verhoeven aus. Interessant fand ich, dass die standardmäßig Hervorhebung mit der [...]

  24. 12 Wordpress Plugins to Display and Highlight Code within your Blog : Speckyboy Design Magazine Says:
    February 19th, 2009 at 11:05 am

    [...] FV Code Highlighter WP Plugin [...]

  25. Booto’Design » Blog Archive » 12 Wordpress Plugins to Display and Highlight Code Says:
    February 20th, 2009 at 8:10 am

    [...] FV Code Highlighter WP Plugin [...]

  26. John Crumpton Says:
    February 25th, 2009 at 10:46 pm

    Great plugin! Any news on the js support?

  27. Hiranthi Says:
    March 9th, 2009 at 12:25 am

    I would love to use this plugin, but for some reason it’s giving me a fatal error on activation (Fatal error: Cannot redeclare class FVCodeHighlighting in /…/wp-content/plugins/fv-code-highlighter/FVCodeHighlighter.php on line 13)..

    Any idea on what’s going wrong?

  28. Hiranthi Says:
    March 9th, 2009 at 1:15 am

    Okay, the fatal error is fixed now. Apparently I had an extra folder called trunk which caused this (just re-downloaded and there isn’t any trunk folder in that one.. odd..).

    Still isn’t working though.. :(

  29. done with blog setup | iPhone Diary Says:
    April 11th, 2009 at 7:45 pm

    [...] FV Code Highlighter [...]

  30. 5 Best Code Highlighting Plugins | ReviewPk Says:
    April 17th, 2009 at 6:51 pm

    [...] 3) FV Code Highlighter [...]

  31. John Says:
    May 13th, 2009 at 4:18 am

    Great plugin. Cannot wait for PHP to start working. Also is there anything in the works for bash?

  32. Du code dans un article Wordpress | Canal 31 Says:
    May 24th, 2009 at 5:50 pm

    [...] avoir recherché et tester de nouveau plugin, je suis tombé sur FV Code Highlight. Ce n’est pas le plus beau, ni le plus complet mais quand je saisi un code, deux jours après [...]

  33. 12 WP Plugins to Display and Highlight Code within your Blog | JT's World Says:
    May 25th, 2009 at 1:00 pm

    [...] FV Code Highlighter WP Plugin [...]

  34. Useful plugin for code | GreyBlogs.com - Themes Says:
    June 20th, 2009 at 1:54 pm

    [...] Do you publish visible code on your blog posts? Here’s a nifty plugin for that: FV Code Highlighter. See how it works here and [...]

  35. American Says:
    July 1st, 2009 at 11:03 pm

    I love this Plugin, It’s great…

    The colors are great, and its working fine in PHP code…

    The only think I will suggest you to add are one or two functions…

    A Copy All Button and why not, a Print Button

    Well that are just ideas from others plugin…

    (Sorry my english, I am from Argentina)

    Are you working in more codes like JS C++ and more?

  36. Richard Says:
    July 4th, 2009 at 6:38 am

    NeatHighlighter.com is a very easy to use highlighter and highlights code in standard colors

  37. >> essencious << » Blog Archive » Code Snippets Plugins Says:
    July 18th, 2009 at 10:39 pm

    [...] FV Code Highligher by Frank Verhoeven. You can view samples on the website. It works for CSS and HTML only at the moment. The design of the code box is pretty. [...]

  38. Interesting Code Highlighters for blogs and websites - Talk about Deal – Blog Says:
    July 28th, 2009 at 9:52 pm

    [...] FV Code HighlighterFrank Verhoeven released this great code higlither that transforms plain text in higlighted code in the same style of the Dreamweaver higligther. The [...]

  39. Kod Renklendiriciler-Code Highlighters | Blogcularin Mekani Says:
    July 29th, 2009 at 12:52 pm

    [...] fv code highlighter frank verhoeven tarafından üretilen bu renklendirici dreamweaver kullanıcılarına pek de yabancı gelmeyecek [...]

  40. Martin-Schubert Says:
    July 30th, 2009 at 12:18 am

    This brings me to an idea:…

  41. Interesting Code Highlighters for blogs and websites « Jasper Blog Says:
    July 30th, 2009 at 8:00 am

    [...] 1. SyntaxHighlighter2. Quick Highlighter3. FV Code Highlightermore.. [...]

  42. Kod Renklendiriciler | Code Highlighters | Aruha Says:
    July 31st, 2009 at 12:40 pm

    [...] fv code highlighter frank verhoeven tarafından üretilen bu renklendirici dreamweaver kullanıcılarına pek de yabancı gelmeyecek [...]

  43. Workpress.net » Blog Archive » How to display raw code in your blog post Says:
    August 15th, 2009 at 3:17 pm

    [...] FV Code Highlighter [...]

  44. mores Says:
    August 18th, 2009 at 6:02 pm

    Same problem as Hiranthi:
    Fatal error: Cannot redeclare class FVCodeHighlighting in /home/.sites/***/***/wp-content/plugins/fv-code-highlighter/FVCodeHighlighter.php on line 13

    Interestingly enough, the plugin works. All code is being displayed all pretty but the plugin is in the “inactive” category.

    Any ideas what went wrong?

  45. Navin Poeran Says:
    August 21st, 2009 at 9:52 pm

    I think it doesn’t work with 2.8.4

  46. podarki Says:
    August 23rd, 2009 at 9:04 am

    Вообще, на мой взгляд, самое лучшее в личном блоге, так это самопознание.

  47. Ricardo Parente Says:
    September 2nd, 2009 at 4:13 am

    Hi Frank, I was wondering if you have intention of extending the code highlight to other languages like ColdFusion (cfml), Flex (mxml).
    If not, where could I jump in to modify the highlighting ? I’m a ColdFusion developer and I post codes in my blog.
    Thanks for your attention.

  48. Coochianohoda Says:
    September 4th, 2009 at 9:12 pm

    Thanks! Good news :)

  49. carlo Says:
    September 7th, 2009 at 8:14 pm

    thanks for this!

    <p>test

  50. 12 Wordpress Plugins To Display and Highlight Code Within Blog Says:
    September 24th, 2009 at 9:04 pm

    [...] FV Code Highlighter WP Plugin [...]

  51. Bqqmf » Code Highlighter, on dit… Says:
    September 28th, 2009 at 11:40 am

    [...] FV-Code Highlighter. Il fonctionne presque mais ne colorie rien! Alors je l’enlève, c’est dommage il faisait partie de ceux qui nécessitent le moins de pirouettes, il suffit d’insérer votre code entre les fausses balises:

     et 

    , où “type” peut prendre les valeurs qui m’ intéressent: HTML, CSS, PHP et XML. Il manque les javascripts, de toute façon. Tant pis. [...]

  52. Valiotoovelia Says:
    October 10th, 2009 at 5:02 am

    Silkroad Online (silk road gold) is a fantasy MMORPG set in the 7th century AD, along the Silk Road between China and Europe. The game requires no periodic subscription fee, but players can purchase premium items to customize or accelerate gameplay.

    Silkroad Online is noted for silk road gold its “Triangular Conflict System” in which characters can select from the three jobs of trader, hunter, and thief to engage each other in player versus player combat. Thieves attack traders who are protected by hunters. Hunters kill thieves getting experience to level up to a higher level of hunter. Traders silk road gold complete trade runs to get experience to level up to a higher level of trader, and thieves kill traders and hunters to level up. Thieves can also steal goods dropped by traders to take to the thieves’ den to exchange for gold and thief experience.

  53. Kod renklendiriciler | вuяαк кαşıкcı.com - wördpires Says:
    November 28th, 2009 at 8:15 am

    [...] fv code highlighter frank verhoeven tarafından üretilen bu renklendirici dreamweaver kullanıcılarına pek de yabancı gelmeyecek [...]

  54. 12 Wordpress Plugins to Display and Highlight Code within your Blog | VNAMEDIA Sharing Center Says:
    December 1st, 2009 at 4:07 pm

    [...] FV Code Highlighter WP Plugin [...]

  55. Afisare de cod Javascript sau Php pe wordpress | Wordpress Says:
    December 18th, 2009 at 6:58 am

    [...] ceva timp am descoperit un plugin denumit FV Code Highlighter care m-a ajutat intr-o anumita masura sa rezolv aceasta problema intr-o anumita [...]

  56. New PHP Highlighter In Town - Frank Verhoeven Says:
    January 9th, 2010 at 9:40 pm

    [...] you could have read here, the current release of my code highlighter has some trouble with highlighting PHP on servers [...]

  57. 10 Wordpress Code Editor Plugin | WordPressPlanet.com Says:
    January 11th, 2010 at 11:06 pm

    [...] FV Code Highlighter WP Plugin [...]

  58. Du code dans ses billets | Tutoweb Says:
    January 17th, 2010 at 5:34 pm

    [...] mon choix s’est tourné vers FV Code Highlighter. Il fonctionne avec HTML, CSS et PHP. La présentation est sobre et imite le code source dans [...]

  59. Highlighting Code within WordPress: Five Tips | WPTemplates.net | Free Wordpress Themes Says:
    January 24th, 2010 at 5:14 pm

    [...] FV Code Highlighter uses a similar format as Dreamweaver to highlight particular types of code so anyone familiar with that coding scheme will have an easy time looking through your coding samples.  It will highlight code from HTML, PHP, CSS and XML.  The highlight colors can be changed if you prefer them something different but the familiarity with Dreamweaver makes the default settings quite useful. [...]

  60. Simon Johnstone Says:
    January 31st, 2010 at 10:17 am

    Awesome Plugin, had a few niggles but after reading others users comments I had it working in no time CHEERS

  61. ikapeng Says:
    February 3rd, 2010 at 6:12 am

    Thanks for the compliment!

  62. 10 Plugins dùng để làm nổi bật code trong bài viết - RubicVn Says:
    February 10th, 2010 at 6:18 am

    [...] vì nó còn tùy thuộc vào nhu cầu của bạn nữa. Hiện tại tôi đang dùng plugin FV Code Highlighter cho blog của [...]

  63. WordPress – Snipers » Blog Archive » Wordpress Plugin – FV Code Highlighter Says:
    February 26th, 2010 at 12:14 pm
  64. Dean Shelton Says:
    February 27th, 2010 at 6:58 pm

    Great plugin! One question. Can you adjust the width of the code snippit without hardcoding a css value for the span class?

  65. ateeq Says:
    March 4th, 2010 at 1:38 pm

    I have been trying to use this plug-in but have not succeeded. I use the syntax mentioned i.e.

     CODEBLOCK 

    . The codeblock is displayed but it is not highlighted. I am currently using wordpress version 2.9.2.

  66. day 4. Wordpress, code display, and other fun | icebluebanana.com Says:
    March 17th, 2010 at 1:26 am

    [...] next one I found was called “FV Code Highlighter” which I found noted in this blog.  I am not sure who speckboy is, but he sure has a great [...]

  67. Top Code Edit Plugins For Wordpress « Click on post Says:
    March 18th, 2010 at 10:23 am

    [...] 6. FV Code Highlighter [...]

  68. How To Use Tr.im URL shortening with the WordPress Twitter Tools plugin | Leo Lincourt Says:
    March 20th, 2010 at 4:19 pm

    [...] you see & in the above code snippet replace it with just &. There’s a bug in the FV Code Highlighter plugin used to display code snippets here that prevents ampersands in code from displaying properly [...]

  69. buzzknow Says:
    March 21st, 2010 at 6:54 pm

    wonderful plugin!

    Thanks a lot :)

  70. 12 plugin để làm nổi bật code trong WordPress Says:
    April 3rd, 2010 at 3:05 pm

    [...] 4. FV Code Highlighter [...]

  71. 29 Plugin ที่ผมใช้งาน ตอนที่ 1 | krapalm.com | กระปาล์ม ดอทคอม Says:
    April 10th, 2010 at 2:38 pm

    [...] FV Code Highlighter ปลั๊กอินตัวนี้ นานๆ จะได้ใช้ที ซึ่งเมื่อไหร่ก็ตามที่ผมมีการเขียนโค้ดโปรแกรม (coding) ลงในบทความ ผมก็จะเรียกใช้งานเจ้าปลั๊กอินนี้ทันที ซึ่งปั๊กอินตัวนี้มันจะทำให้ เราอ่าน Code ที่เราเขียนลงในบทความง่ายขึ้น มีการทำ highligh Code ให้สีแตกต่างกันออกไป ทำให้ง่ายต่อการอ่านครับ [...]

  72. Michael Says:
    April 17th, 2010 at 5:14 pm

    Hi,

    first of all thank you very much for this great plugin.

    And I have a question, why does this plugin write some tags in there which do not exist in my code? Look at the screenshot:

    http://emdesigns.de/demo/code1.jpg

    and

    http://emdesigns.de/demo/code2.jpg

    I hope you can help me.

  73. Valentin Yonte Says:
    April 20th, 2010 at 10:47 pm

    Hi there,
    Where must I put the code. I would like to use it on wordpress theme editor. I put the code on theme-editor.php, but I can not see any difference.

    Thanks
    Valentin

  74. Zhang Says:
    April 24th, 2010 at 8:11 am

    I want use it.But wordpress told me the header have a mistake.

  75. Bob Timm Says:
    April 28th, 2010 at 5:24 pm

    Frank, great tool. Please add to your docs up at the top that you need to specify {code type=XXX} Although it makes complete sense, most of us are looking for a quick solution and do not always think as deeply as the designer. We obviously code -but we’re lazy too bud. :)

  76. كيف تظهر الكود بشكل جيد في تدويناتك؟؟ Says:
    May 23rd, 2010 at 10:59 pm

    [...] FV Code Highlighter [...]

  77. krapalm Says:
    May 25th, 2010 at 6:14 am
    
    .horizontalaccordion>ul {
        margin: 0;
        padding: 0;
        list-style:none;
       	height: 300px;
    }
    
  78. Top 10 Little Known Wordpress Plugins | TrafficHoss.com Says:
    June 6th, 2010 at 10:37 pm

    [...] FV Code Highlighter – Developed to give the blogger full control over their codes, FV Code Highlighter will allow you to highlight HTML, CSS, PHP, or JavaScript with ease. submit_url = 'http://traffichoss.com/my-top-10-wordpress-plugins/'; [...]

  79. 12 plugin để làm nổi bật code trong WordPress – Jin9x's Blog Says:
    June 20th, 2010 at 3:33 pm

    [...] 4. FV Code Highlighter [...]

  80. Aris Says:
    June 22nd, 2010 at 12:28 am

    Nice work! and thank you very much for this wonderful plugin…

Leave a Reply