Shami's Blog

DevOps because uptime is not optional

Writing Code Segments Under Wrodpress

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:

1<pre><code>This is some code
2    Indentation also works
3</code></pre>

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.

Categories