by Howard B. Richman
I prefer the look of smart or curly quotes but sometimes you need the simple or dumb quotes. WordPress tends to change all quotes to curly quotes and the normal solutions to fix this seem to be an all or nothing process, which is not satisfactory.
“Example of ‘Smart’ Quotes”
"Example of 'Dumb' Quotes"
Why Would you Need Simple or Dumb Quotes?
The main reason you might want to use the simple quotes is when you want to illustrate some javascript code on your page. THE CODE WILL NOT WORK WITH FANCY QUOTES!!!!! It requires old-fashioned, simple quotes.
Example Code As Displayed by WordPress (Notice the Single and Double Quotes Have Become “Smart.”)
function changeBackground(color) {
document.body.style.background = color;
}
<BODY onload=”changeBackground(‘red’);”>
Example Code As Displayed by WordPress, With our Solution Implemented (Notice the Single and Double Quotes Remain “Dumb.”)
function changeBackground(color) {
document.body.style.background = color;
}
<BODY onload="changeBackground('red');">
Problems with Most Solutions that are Recommended
- The MAIN issue I have with most solutions is that they are “site-wide,” meaning that when you find a way to make quotes simple, it will AFFECT YOUR WHOLE SITE! (In my case, I actually LIKE smart quotes. I just want the option to SELECTIVELY change this function as needed but not implement this change on my whole site.)
- Another issue with most solutions that I don’t like is that they require that you alter your functions.php file. The main reason this is not so good is that every time you update your THEME, you might be at risk for undoing any changes and you have to manually remember to REDO those changes. (Yikes).
Here is our Best Solution to Selectively Disable Smart Quotes in WordPress
- DOWNLOAD, install and activate the TinyMCE Advanced plugin to substitute for the existing text editor that you already have within WordPress.
- In the settings screen for the plugin, DRAG buttons from the unused buttons below and drop them in the toolbars above, or drag the buttons in the toolbars to rearrange them. The primary button that you will need for this is the “Code” button (NOT “SOURCE CODE,” JUST “CODE.”)
- When you get to your page you are editing, you should now see the button in your text editor. If you don’t, click on the “Toolbar Toggle” button to display all your tool options:
- Paste in your desired code into your page.
- Select the code.
- Click ONE TIME on the code button. Note that it will CHANGE the font to COURIER. If you want it to display as a different font, chose which font you want FIRST: (Select the code and then choose font.) and THEN click on the button.
- Easy! You did it!