Displaying Code Easily
Filed Under: Plugins
Do you have a need to display code on your blog? Great, well here is a plug-in that I found.
Since I am writing articles and a blog about blogging, and sometimes things that need code for your page. I have looked over the internet to find a plug-in that will cleanly allow you to show your code easily. Pryadi’s Place has the plugin that I used. Go ahead and visit his site, and download the plugin here.
Here is the easy steps:
- Download the plugin.
- Rename the file into codeautoescape.php and put it in your wp-content/plugins directory.
- Activate the plugin from WordPress administration page.
Now all you have to do is add two basic declarations into your CSS file. The first one is your pre tag. This tag will display the things with more than one line of code, or whatever you decide it to contain. The next is your code tag.
Here is what I used for the tags:
pre, code {
border: 1px solid #999;
color: #000;
margin: 5px;
padding:10px;
background: #ececec
}
You can use the same declaration for both of the tags, so that way everything looks the same. You basically use the pre tag with code inside, for code that is more than one line. You would use just the code tag for code that would only display one line of code. That’s it. You can now display code very easily.




