• Resolved jmatthewgore

    (@jmatthewgore)


    For some reason, my thumbnail images in my quiz are not showing up. Initially, the thumbnails DID show up and worked fine, but I think with one of the past couple of plugin updates, they stopped working.

    This is the problem:

    The image URL in the questions in the quiz shows up as something like:
    https://www.lightandmatter.org/wp-content/uploads/2019/09/maddy-1a-200%C3%97300.jpg
    (except the %C3%97 shows up as a non-standard “X” character.)

    The actual URL of the image is (and should be):
    https://www.lightandmatter.org/wp-content/uploads/2019/09/maddy-1a-200×300.jpg

    This ONLY happens within the quiz questions on my website. Other images show up as expected throughout my posts.

    If I remove the images from questions and re-add them, that doesn’t fix anything, nor does creating new questions.

    I’m running Litespeed server and PHP 7.2. Latest version of WordPress and QSM plugin, with the Zeen theme by Tipi. I’ve tried disabling all of my other plugins that might be relevant (caching, image optimization, JetPack) but to no effect.

    Any suggestions?

    • This topic was modified 4 years, 10 months ago by jmatthewgore.
    • This topic was modified 4 years, 10 months ago by jmatthewgore.
    • This topic was modified 4 years, 10 months ago by jmatthewgore.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter jmatthewgore

    (@jmatthewgore)

    Well, now I’m even more confused. As you can see in the second example link above, when I posted that link, I used an “x” between the 200 and 300. It seems that something HERE automatically changed it to the UTF-8 character, which doesn’t match my file name. Maybe that’s a common thing, and this is a problem with my server.

    Hi,

    We have recorded this as a bug and we are trying to resolve it in the next version update.

    Kind regards,
    Kriti

    This is caused by the wptexturize filter (which is hooked via the_content). You should probably disable that before running apply_filters('the_content', [...]).

    Temporary fix for anyone who needs it in the meantime:

    add_action('wp_head', function() {
        if (get_post_type() === 'quiz') {
            remove_filter('the_content', 'wptexturize', 10);
        }
    });
    • This reply was modified 4 years, 10 months ago by Mikk3lRo.

    Hi there,

    Thank you for providing a quick fix for other users.

    Regards,
    Kriti

    Thread Starter jmatthewgore

    (@jmatthewgore)

    @mikk3lro Thanks for the help! Before I start playing with this… where do I add your temporary fix code? Is this something that goes in the plugin’s main PHP file (mlw_quizmaster2.php) or should I be looking elsewhere?

    Thanks Again
    Matt

    @jmatthewgore I can’t recommend modifying core, theme or plugin code you didn’t write… but yeah, that would work…

    However, it’s better practice to stick it in your theme’s functions.php if you have a child theme already… if not it would make a great micro-plugin… fx:

    <?php
    /*
    Plugin Name: Fix wptexturize in quiz
    Version: 0.0.1
    Author: Me
    */
    
    add_action('wp_head', function() {
        if (get_post_type() === 'quiz') {
            remove_filter('the_content', 'wptexturize', 10);
        }
    });
    

    Dump that in wp-content/plugins/fixwptexturize/fixwptexturize.php and you should be able to enable it under plugins in the admin… added benefit: you’ve just created your first plugin ??

    Thread Starter jmatthewgore

    (@jmatthewgore)

    @mikk3lro Awesome. Thanks again!

    Hi,

    We have resolved this issue in the latest version release.

    Regards,
    Kriti

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Image Thumbnails in Quiz don’t show up’ is closed to new replies.