Wp Affiliate Pro - The #1 Plugin For WordPress Blogs
Powered by MaxBlogPress  

 

Highlighting or escaping code in Wordpress is easy | JTPRATT's Blogging Mistakes
JTPratt's Blogging Mistakes





Home » Highlighting or escaping code in Wordpress is easy


 
 
 

Posted in:

blog-setup category image wordpress category image wordpress-plugins category image
1,594 views


If you need to post some html, css, or other kind of programming code in your Wordpress blog - it all gets eaten up when your save or publish the post - especially if you use the visual editor (tinyMCE). Highlighting or escaping that code in it’s proper syntax is easy - if you have the right Wordpress plugin.

I’ve downloaded and tried quite a few of these over the last year, and none really seemed to work that good for me. I don’t know if it was because I was using the visual editor most of the time or what - but they didn’t seem to escape code like they said they would. With some of these recent Wordpress hack posts I’ve had a need to post code - so the issue arose again. After googling around a bit, I figured that this problem already had to be solved by someone already. So I took a look at the Wordpress 2.3 Plugin Compatibility Page to see what was listed there for code syntax highlighting in Wordpress and found 3 options.

I’ve seen so many broken plugins on the web - if you ever have any problems with your WP install always check the latest compatibility page to make sure that everything you’re using works with the WP version you have installed. Two out of the three options I had trouble with for one reason or another - and that left one to try which is the Code Autoescape Wordpress plugin. It works like a charm for me is is very easy to use. Just escape code with the code tag, or pre and then code tag for multiple lines - and makes your code block.

let’s escape some code here:

.style {
padding: 10px;
}
<title>goes here</title>

that’s it - all there is to it! The only reason I type up little tips like this is usually because it was something I had a hard time finding in google myself. I’m hoping that someone in need google’s this page and finds their fix quickly! If this post helped you or if you have an additional quesiton - comment now!


2 Responses to “Highlighting or escaping code in Wordpress is easy”

  1. 50 tips y trucos para optimizar Blogger y WP | Blog en Serio Has the following to say...

    [...] Resaltar texto que sea código en los posts [...]

  2. 25 hacks para dinamizar seu Wordpress! — Bytes a Go-go! Has the following to say...

    [...] Escrever códigos no post. Bastante útil para quem tem um blog de programação. [...]

Question or Comment?? Spill it Now...

Jumping for Joy over comments!

We Reward Comments!


We dofollow links, and get your latest blog post as a byline under every new comment from the "CommentLuv" plugin! Top commenters for every month are listed on every page of this site in a sidebar widget linked back to your URL! We would like to reward you for becoming part of our community! Your comment is valuable not only to us, but also all the other readers of this blog!
 

 


Click to add smilies to your post! = =[] ^=( =(( =(| =)r =|8 =0 =)~ =00 =( =;; =)] =;;;