Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 95984

magmac on "Smart Quotes code broke my site!"

$
0
0

Having trouble with smart quotes on my blog - they look screwy in feeds. Found a solution at this site:

http://www.cyberscorpion.com/2011-05/how-to-turn-off-curly-quotes-in-wordpress-so-they-dont-break-your-php-tutorials/

I added this code to my functions.php as directed:

<?php
function removesmartquotes($content) {
     $content = str_replace('“', '"', $content);
     $content = str_replace('”', '"', $content);
     $content = str_replace('‘', ''', $content);
     $content = str_replace('’', ''', $content);

     return $content;
}
add_filter('the_content', 'removesmartquotes');
add_filter('comment_text', 'removesmartquotes');
?>

[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

I then got this error message:
Parse error: syntax error, unexpected '<' in /home2/civilwb5/public_html/wp-content/themes/travelify/functions.php on line 105

which I did not know how to correct, so I removed the code, and it broke my site:

http://civilwarwomenblog.com

Please help!


Viewing all articles
Browse latest Browse all 95984

Trending Articles