How to display code In WordPress Posts

Sometimes it is very important to be able to display chunks of code in your posts so as to provide examples or solution for your readers. However this task requires extra work and more pacience since you will have to use character entities to replace all the <> brackets with its corresponding signs. Imagine that your blog is all about coding tutorials it will be too uncomfortable and time consuming to do all the character entities manually. Luckyly if your blog is powered by wordpress there are several plugins that can do the task automatically for you. All what you are gonna need to do while writing or editing your post is to put the code, you want to disply for your readers, between the following tags . And the rest will be taken care of by the plugin in question.

1 – download the plugin from here: wp-codeshield
2 – upload the containing folder to your plugins folder
3 – You will need to login to your wordpress dashboard and activate the plugin
4 – Make sure you enclose between code tags all the code you want to display

In case you need something more elegant and interactive, you might want to install a different plugin for example the SyntaxHighlighter Evolved. This plugin can be used to highlight more than 15 programming langages and uses separate syntax files called brushes to define its highlighting functionality. This plugin comes with step by step setup information.

Well, I think tha is all for now. All your comments and questions are welcome.

Tags: , , , , , ,

Follow the responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

Leave a Reply




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>