WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. NitroPress
    Member
    Posted 3 months 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
    Member
    Theme Author

    Posted 3 months 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:

    http://pippinsplugins.com/never-remove-the-default-the_content-filters-in-themes/

    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
    Member
    Theme Author

    Posted 3 months 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
    Member
    Posted 3 months 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
    Member
    Posted 3 months ago #

    Patch works perfectly. Thanks!

  6. Tomas Mackevicius
    Member
    Theme Author

    Posted 3 months 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 :)

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.