LEXIPIXEL, more than just a palindrome!
• Web Designer • Web Developer • Volusion • OSCommerce • WordPress Blog • Themes • Photoshop • .PSD • Templates • Logo Design • CSS • CMS • eCommerce • Online Stores • Shopping Cart • Merchant Account • Hosting • Search Engine Marketing (SEM) • Search Engine Optimization (SEO) • Solutions! • Training & Support

December 19, 2010

Turn Off WordPress Curly Quotes

Filed under: Wordpress
Randy Harris @ 6:00 am

By default, WordPress attempts to find pairs of single or double quote marks, and converts them to curly quotes, (or "smart quotes" as they're called --- with the one on the left curling one way and the one on the right curling in the other way).

This is all well and good for appearance sake when you're posting articles made up of paragraphs of text, headings, etc -- but is extremely annoying when you're posting computer programming code examples.

Most computer programming languages extensively use quote marks, (single and double), for formatting and parsing code.

In WordPress, the conversion is done by the wptexturize function.  Luckily, you can turn it off in most areas of your blog by locating the specific places and adding a remove_filter() instruction in your template's functions.php file.

The code below turns off wptexturize for titles, content, (and RSS content).

<?php
// ======================
// turn off smart quotes
// ======================
//
remove_filter('the_content', 'wptexturize');
remove_filter('the_rss_content', 'wptexturize');
remove_filter('the_title', 'wptexturize');
//
?>

Simply cut and paste the above code into your functions.php files, click  Update File, and those curly quotes should be gone.

###








Home | Site Map | Links | Email Us

• eCommerce Websites • Shopping Carts • Online Stores •
• Web Design • Photoshop • Logo Design • Custom Programming •
• SEO • SEM • PPC • Display Ads • Solutions! •

Contact: Randy Harris (508) 371-8822
Framingham, MA (USA)

Copyright ©1994-2020 LEXIPIXEL.COM, all rights reserved.