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.


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

About Me

Dev gone Ops gone DevOps. Any views expressed on this blog are mine alone and do not necessarily reflect the views of my employer.