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

    https://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:

    https://civilwarwomenblog.com

    Please help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Download a new copy of your theme here:

    https://www.ads-software.com/themes/travelify

    Then using FTP (or Cpanel) access replace that functions file with a new copy from the download – you can find it here:

    wp-content
        themes
            travelify
                functions.php

    Thread Starter magmac

    (@magmac)

    Thank you so much for your prompt response. Real life issues kept me away from my computer for several hours. I have now followed all instructions you suggested, but unfortunately I still cannot access my site.

    Maybe it’s time to change my theme ??

    Try deactivating the theme by changing the name on the theme folder:

    wp-content
        themes
            travelify.HOLD

    That should force WP to use twentythirteen and let you login again.

    Thread Starter magmac

    (@magmac)

    That works great, but when I rename it again, nothing works and my blog is still not visible.

    Sorry to be such a bother…

    Yes, I’d expect that since it’s apparently messed up :). Try deleting that theme and reinstalling it entirely. (IF you’ve changed theme files, you’ll lose those changes…)

    Thread Starter magmac

    (@magmac)

    Since I can’t access my wp-admin, I will have to delete and reinstall the theme thru my host provider cpanel, correct?

    Yes, delete it that way – then you should be able to login and reinstall from the Dashboard.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Smart Quotes code broke my site!’ is closed to new replies.