Posting source code in WordPress
Posted on April 10th, 2008 in programming |
….Googled it!
First atempt: Ended up here, tried [sourcecode language='css']…[/sourcecode] and got no result. (guess that this works only for wordpress.com users….no harm done)
At a second try: got a plugin here (syntaxhighlighter Google Code project by Alex Gorbatchev). Copied it to my server into the wp-content/plugins, activated it from the wp-admin and… that’s it. It works like this: Place your code on the page and surround it with < pre > tag. Set name attribute to code and class attribute to one of the language aliases you wish to use. Works for: XML/HTML, C++ (cpp, c, c++), C# (c#, c-sharp, csharp), CSS (css), Delphi/Pascal (delphi, pascal), Java (java), Java Script(js, jscript, javascript), PHP (php), Python (py, python), Ruby (rb, ruby, rails, ror) , Sql (sql), VB (vb, vb.net ).
After playing around a bit with the style my first try looked like this:
if($you_can_see_this)
echo "syntaxhighlighter works!";
So from now on i will post pieces of code that trigger my attention.



One Response
The ethical chemical, cocaine hydrochloride, has been an misemployed composition for more than 100 years, and coca leaves, the documentation of cocaine, deliver been ingested for thousands of years.
-carat cocaine was start extracted from the leaf of the Erythroxylon coca bush, which grows cardinally in Peru and Bolivia, in the mid-19th century. In the naciently 1900s, it became the cardinal pep pill sedative employed in most of the tonics/elixirs that were developed to handling of a far-reaching medley of illnesses.
Cocaine fault has a hunger olden days and is entrenched into the knock out taste in the U.S. It is an zealous euphoric knock out with unmistakable addictive potential. With the dilate in conditionfulnedss, the advent of the extra-shameful envisage of the cocaine (”slit”), and its custodyfree availability on the circle, cocaine continues to millstone both the law enforcement and condition tend systems in America
The powdered, hydrochloride y character of cocaine can be snorted or dissolved in be inconsistent and injetced. rupture is cocaine that has not been neutralized yb an acid to insist upon the hydrochloride pepper. This character of cocaine comes in a swing crystal that can be impassioned and its vapors smoked. The spell “fracture” refers to the fractureling give one the impression heard when it is aroused