How to add code box in WordPress blog?

Adding code box to write a coding is quite simple in wordpress blogs. You can use any of three tags to writing code within. These are <code>, <tt> and <pre> tag. Using <code> and <pre> tag you can simply differentiate between the code you write and the rest of the text content in your post.

This is an example of <code> tag.

This is an example of <tt> tag.

But, by using <pre> tag, you can define a box in which your code will be displayed.

 This is <pre> tag example. 

Also, you can change the style/layout of <pre> tag by changing it’s style.css stylesheet file located in your current WordPress theme directory.


Published by


I am the one who discover myself daily through reading, writing, interacting with people and expressing my thoughts to inspire them if I would be able to bring a little change to the society through my work. I write blogs, participate in various social activities and want to be a Professional Speaker. Currently, I am pursuing my post graduation in Computer Applications from Guru Nanak Dev Engineering College, Ludhiana and I’m very much active in many technical & social communities.

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s