Support » Plugins » Replace curly quotes with straight quotes

  • I’m trying to replace curly quotes. I added the following to my theme’s function.php but it doesn’t seem to be working? Any ideas? Thanks.

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

    $content = str_replace(““”, “"”, $content);
    $content = str_replace(“””, “"”, $content);
    $content = str_replace(“‘”, “'”, $content);
    $content = str_replace(“’”, “'”, $content);
    $content = str_replace(“—”, “–“, $content);
    $content = str_replace(“…”, “…”, $content);

    return $content;
    }
    add_filter(‘the_title’, ‘removesmartquotes’);
    add_filter(‘the_excerpt’, ‘removesmartquotes’);
    add_filter(‘the_content’, ‘removesmartquotes’);

  • The topic ‘Replace curly quotes with straight quotes’ is closed to new replies.