Posts tagged as:

wordpress

How to turn off WordPress smart quotes

Post image for How to turn off WordPress smart quotes

by bledsoe on January 30, 2010

Smart quotes (aka curly quotes) are what most word processor programs insert into your document when you type the quote marks key.  They're pretty to look at, but they cause problems if you use them in a text document that contains code intended to be read by a computer.  That's normally not a problem since text editors don't create smart quotes when you type the quote key, but if you happen to find a cool chunk of code on a blog somewhere and you cut and paste it into a text file, if the blog you're copying the code from uses curly quotes, then you have a problem.

The bad news is, WordPress automatically converts all quote symbols to smart quotes, so if you post code snippets to your blog and they have quote marks in them, anyone who attempts to copy and paste that code into their own text file is going to have problems running the code. The good news is, you can turn this feature off.

There are actually a few different ways to do this, including modifying the functions.php file in your theme folder, or modifying the default-filters.php file in your wp-includes folder. But I like creating a separate php file and making it into a WordPress plugin, as described in this post by Katja Stokley. 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.

{ 7 comments }

How to align your custom header with your navbar

January 21, 2010
Thumbnail image for How to align your custom header with your navbar

If you use the Thesis theme for your WordPress blog, you might have created your own custom header image for your site (kind of like mine, above).  If so, you may have noticed that your header image doesn't seem to align correctly with your navbar.  To get your header image and your navbar aligned, you'll [...]

Read the full article →

Removing the whitespace at the top of your Thesis blog

January 19, 2010
Thumbnail image for Removing the whitespace at the top of your Thesis blog

If you use the Thesis theme for your WordPress blog, you might have created your own custom header image for your site (kind of like mine, above).  If so, you may have noticed that there's a little bit of whitespace between the top of your browser window and the top of your header image (kind [...]

Read the full article →

A simple tweak for the WordPress YARPP plugin

August 16, 2009
Thumbnail image for A simple tweak for the WordPress YARPP plugin

Someone recently asked me to make a small change to the Yet Another Related Posts Plugin (YARPP) which she had recently added to her WordPress site.  (For each of your published posts, YARPP will display a list of related posts, the idea being that if readers enjoyed the post they just read, they might want [...]

Read the full article →

How to add clickable icons to your WordPress sidebar

July 28, 2009
Thumbnail image for How to add clickable icons to your WordPress sidebar

You know how a lot of WordPress blogs have nifty icons in one of the sidebars, ones you can click on to go to, say, that blogger's twitter or facebook page?  They're really simple to add. It's essentially a 2-step process: Upload the icon image(s) to your media library.  You can find a ton of [...]

Read the full article →

Merging WordPress blogs

July 20, 2009
Thumbnail image for Merging WordPress blogs

Merging two or more WordPress blogs is a fairly straightforward task.  The exporting and importing steps, which actually copy all of your blog posts from your source blog(s) and move them into your target blog, are handled with just a few clicks of the mouse button.  The planning beforehand and the cleanup afterward take a [...]

Read the full article →

Understanding the WordPress API key

July 16, 2009
Thumbnail image for Understanding the WordPress API key

Most people develop an interest in the WordPress API key when they discover Akismet, a handy plugin that handles comment spam.  Unfortunately, in order to activate this plugin (and some others), you have to have something called a WordPress API key, and the process of acquiring one can be a little confusing.  Here are a [...]

Read the full article →

Understanding avatars and gravatars

July 12, 2009
Thumbnail image for Understanding avatars and gravatars

Have you ever noticed how on some blogs, when people leave comments there's a small photo or icon that appears next to all of their comments?  Have you ever wondered how to make your own photo/icon show up next to your blog comments? Those little photo/icon things used to be (and sometimes still are) called [...]

Read the full article →

Using categories and permalinks on your blog: A simple approach

July 9, 2009
Thumbnail image for Using categories and permalinks on your blog: A simple approach

When I first started blogging, I ignored both categories and permalinks.  I didn't really understand what either was for, but I just wanted to get my blog up and running and figured I'd worry about them later.  Now that I've been thru several different blog incarnations (both mine and others), I have a better understanding [...]

Read the full article →

Understanding RSS and Web Feeds

July 6, 2009
Thumbnail image for Understanding RSS and Web Feeds

For a long time I had a vague understanding of RSS as something that let me know when one of my favorite blogs was updated, but always felt a little unclear on some of the basics.  Here's a short explanation of RSS, and of web feeds in general. A web feed is useful for a [...]

Read the full article →