Tiny Forge
[resolved] Enable curly quotes permanently? (6 posts)

  1. NitroPress
    Posted 2 years ago #

    I just resolved a nagging issue with WP/TF not changing straight quotes to curly ones - the documentation of TF tips makes it seem that it's an option to preserve straight quotes, but the code in functions.php makes it a default.

    As I want fancy/curly/typographical quotes by default, I have to disable the function 'remove_filter()' in functions.php. This will get overwritten by at least some theme updates, right? I looked at the child theme functions.php, but there's no code related to that function. How do I go about making a change to the main-theme functions.php persistent over theme updates? Or otherwise force the theme to leave quote conversion alone so that both posts and comments use curly quotes?

  2. Tomas Mackevicius
    Theme Author

    Posted 2 years ago #

    Good question :)

    It looks that you can re-establish the filter in a child theme with:

    add_filter( 'the_content', 'wptexturize' );

    From the topic at: http://wordpress.org/support/topic/how-to-reverse-effect-of-wpautop-and-wptexturize-on-multi-line-shortcode

    So can you test this filter and report back if it works?

    But after reading this:


    I'm thinking about commenting out that filter in the future version, so users could uncomment it in a child theme.

    Also can you show the site you're working on?

  3. Tomas Mackevicius
    Theme Author

    Posted 2 years ago #

    Anyway, I decided to leave parent as it is, but to make things easier I will add this to a child theme example:

    function tinyforgechild_undo_wptexturize_hooks( $length ) {
    	add_filter('the_content', 'wptexturize');
    	add_filter ('the_excerpt', 'wptexturize');
    	add_filter ('comment_text', 'wptexturize');
    add_action( 'after_setup_theme', 'tinyforgechild_undo_wptexturize_hooks' );

    Credit goes to Otto: http://ottopress.com/2010/wordpress-protip-child-themes/

    You can use it too. Also it looks that things might change starting WP 4.0: https://core.trac.wordpress.org/ticket/19550

  4. NitroPress
    Posted 2 years ago #

    Thanks for the prompt reply and fix. I haven't tried it yet but will - I assume this goes in functions.php in the child theme?

    I understand why the code-centric sites would want the quote conversion disabled, but as a designer I prefer the esthetics of proper quotes... it seems like there should be a high-level WP configuration option for this instead of burying it in themes, hacks and plugins. But oh, well.

    Site is at http://tinyurl.com/msu9wtc (tiny'ed because I'd rather not have a search link between here and there). I've done a lot of tinkering at the child theme level to smooth things to my liking... excellent theme in appearance and implementation, though. Thanks!

  5. NitroPress
    Posted 2 years ago #

    Patch works perfectly. Thanks!

  6. Tomas Mackevicius
    Theme Author

    Posted 2 years ago #

    You're welcome!

    If you will have any other sites running on TF, please let me know - it's always nice to see how people implement it :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic


No tags yet.