Shami's Blog

Sysadmin, Because Even Developers Need Heroes

Writing Code Segments Under Wrodpress

2008-03-04 by Mohammad H. Al-Shami

So yesterday while I was writing the previous post I noticed that WordPress would try to make what I write look more “User Friendly”. Well, it works most of the time, but it doesn’t do a good job when it comes to code, it took me a while to get this fixed.

Basically what you need to do is get the Code Markup plugin, activate it, and then enclose the code segment you have in a “code” tag. Also make sure to enclose the “<code>” tag within a “<pre>” tag. For indentation use spaces.

Sample:

<pre><code>This is some code
    Indentation also works
</code></pre>


comment: