Click here to get twenty dollars off Webhosting at DreamHost
Powered by MaxBlogPress 

Sayonara Curly Quotes!!



February 8th, 2009 01:05 am | by Ed |

I don't know about anybody else but I absolutely hate "curly quotes". I hate them because just when I need regular plain old double quotes, WordPress comes along and very nicely converts them to curly quotes. I've had several times when this has caused me seemingly endless trouble on occasions when I would be posting snippets of code. Something that the powers that be in the WordPress franchise apparently don't get is that code doesn't always work right when WP converts the double quotes into curly quotes.

Not to mention how much of a royal pain in the ass it is to convert 'em back!

I've spent a bunch of time searching for a way to get it to not convert characters. Frankly, I don't really want it converting ANY characters into their allegedly "prettier" high ascii counterparts. I'm not the least bit interested in what some programmer or developer somewhere thinks "looks better". If I TYPE a double quote, then that's what I bloody want to see when I load the page in a browser.

So, today I once again set out to find a way to fix this ugliness and I finally found success. wprecipes.com had the answer and as I should have expected, it's easier than falling off a log.

According to what I read on WPRecipes, all I needed to do was open the "functions.php" file for the blog theme and add these three lines of code:

<?php remove_filter('the_content', 'wptexturize'); ?>
<?php remove_filter('the_title', 'wptexturize'); ?>
<?php remove_filter('comments', 'wptexturize'); ?>

And the curly quotes would be gone from my post content, comments, and titles. I inserted the code and re-uploaded the file, loaded the blog and finally was rewarded with success. No more curly quotes. I'm now going to add this bit of code to the functions.php file in all of my blogs.

I am through looking at curly quotes on my own blogs at least.

Technorati Tags: quotes, ascii, wordpress, curly quotes, wordpress hacks, functions.php, remove curly quotes, double quotes, hacks, wprecipe

Be Sociable, Share!
  • email
If you enjoyed this post, make sure you subscribe to my RSS feed!
Want to link to this post?
Just copy this code and paste it on your site where you want the link to appear:

No Comments

Sorry, the comment form is closed at this time.