Blog > detail

Just my tiny mind

Publish Code in Wordpress

26-2-2012 Admin General 2 Comments

Publish Code in Wordpress

It is may be dificult for people to Publish Code in Wordpress. I have tried to use <textarea> and it wont work perfectly. Change < into &lt; is not user friendly. However, Publish Code in Wordpress is not that hard.


First, know what code you are using, it might be one of these codes:


Bash —> bash

C++ —> cpp

C# —> csharp

CSS —> css

Delphi —> delphi, pascal

Diff —> diff

Groovy —> groovy

Java —> java

JavaScript —> jscript, javascript

Perl —> perl

PHP —> php

Plain text —> plain, text

Python —> python

Ruby —> ruby

Scala —> scala

SQL —> sql

VB —> vb

XML/HTML —> xml, html, xhtml


Second, type the wordpress tag

[sourcecode language="***"]***[/source code]

Third, fill the first *** with code type and the second *** with the code it self

[sourcecode language="css"]#new_window .background{ display: none; position:fixed ; top: 0; left: 0; right: 0; bottom: 0; background-color: black; z-index:1001; -moz-opacity: 0.8; opacity:.70; filter: alpha(opacity=80); text-align:center;} #new_window .content{ display: none; position:absolute; text-align:center; z-index:1002; left: 458px; top: 50px; width: 350px; height: 200px; border: 2px solid; border-color:#CCCCCC; background-color: white;}[/source code]

Warning: [/source code] should be [/sourcecode] without space like image bellow.


wordpress sourcecode tag


Fourth, you already have the skill to Publish Code in Wordpress.


Good Luck

Publish Code in Wordpress Publish Code in Wordpress Publish Code in Wordpress

Publish Code in Wordpress Publish Code in Wordpress Publish Code in Wordpress

Publish Code in Wordpress

Publish Code in Wordpress

Publish Code in Wordpress

Publish Code in Wordpress

word word