August 7, 2010

Text pre formatting in WordPress

Filed under: WordPress — Tags: , , , , , — shijitht @ 2:11 pm

To insert a code or a pre formatted text, you can use “Preformatted” instead of “Paragraph” in visual editor. For html editor corresponding tag is pre. In html editor enclose the text in these tags.

<pre> text </pre>.

For writing code you can use code tag.

<code> code </code>.

For coloring the code according to language syntax and proper listing, use sourcecode tag. Use it as


lang could be

  • actionscript3
  • bash
  • coldfusion
  • cpp
  • csharp
  • css
  • delphi
  • erlang
  • fsharp
  • diff
  • groovy
  • javascript
  • java
  • javafx
  • matlab (keywords only)
  • objc
  • perl
  • php
  • text
  • powershell
  • python
  • ruby
  • scala
  • sql
  • vb
  • xml

For more details go to http://en.support.wordpress.com/code/.



  1. Thanks for writing this. I’m looking for why 2 of my blogs don’t have the paragraph drop down options in visual anymore. Thoughts?

    Comment by desaraev — August 28, 2010 @ 4:23 am

  2. sorry. Try JS.

    Comment by shijitht — August 28, 2010 @ 7:58 am

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: