I recently, ran into an issue at work where I needed to find out who had rebooted my server. I recalled writing a post about it here, so I went and snagged the code.
After changing the server name I ran the code and promptly received an error like the one in the graphic above.
After playing around with it for a few minutes, I realized that the single tick marks were causing the issue. After investigating further, I found this post which explains the why and give an example of how to fix it.
You can follow the link if you like, below is what I did.
Create a text file called TurnOffSmartQuotes.php and put this in it:
<?php
/*
Plugin Name: TurnOffSmartQuotes
Plugin URI:
Description: Stops WordPress from converting your quote symbols into smartquotes. The three lines below stop the smartquote conversion in 1) your post content, 2) your comments, and 3) your post excerpts.
Version: 0.1
Author: Katja Stokley
Author URI:
*/
remove_filter('the_content', 'wptexturize');
remove_filter('comment_text', 'wptexturize');
remove_filter('the_excerpt', 'wptexturize');
?>
Then just upload this file to your wp-content/plugins folder, login to your WordPress dashboard, select "Plugins," and activate your new plugin. You've just turned off smart quotes on your WordPress blog.
Update
All, Lance Bledsoe posted, below, about this article not providing a link to his site.
It is important to note that I do not post for recognition, nor do I require it from anyone who copy's from this page, but I would not intentionally prevent anyone from getting the credit they deserve.
In that vein, please visit Lance Bledsoe's site. The information contained there is very useful.
Thanks for the link, Andy! Glad my post was helpful.
Lance,
Nothing personal, I am not even sure where the information came from.
Obviously I wasn't attempting to represent someone elses work as my own, for if I were I would not have put the code in with the authors name.
Again, my apologies...
All, please visit http://www.lancebledsoe.com/how-to-turn-off-wordpress-smart-quotes/ for another article on this subject which may be even more helpful than this one.
If you are going for finest contents llike me, only visit this site all thhe time because it presents quality contents, thanks
Its lijke you read mmy mind! You apprar to know so much about this, like you wrote the book in it or something.
I think that you can do with a few pucs to drive the
message home a bit, but othr than that, this is wonderful blog.
A great read. I will certainly be back.