Hi @gertruda ,
Thank you for your feedback — I’m glad to hear that you’re enjoying the plugin. I also appreciate the creative way you’ve built your quiz using image-based answers.
Regarding your request to display only the caption (instead of both the image and caption) in emails and on the result page:
Currently, the plugin only supports displaying both the image and caption together. I’ll review this further and get back to you with a possible method to display only the caption.
Thank you for your time and cooperation.
Best regards,
Dhanush
Dear @gertruda ,
I hope you are doing well. Apologies for the delay in getting back to you.
We have identified a solution that allows image captions to be displayed instead of images, both in emails and on the result page.
You can implement this by adding the following code to either your child theme’s functions.php file or the QSM plugin’s functions.php file. Please note that modifications to the plugin file may be overwritten during updates, so using a child theme is recommended for safety.
code:
add_filter( 'qsm_results_css_inliner', 'qsm_remove_img_tags_from_content', 10, 3 );
function qsm_remove_img_tags_from_content( $content, $response_data, $index ) {
return preg_replace( '/]*>/i', '', $content );
}
We have specifically customized this code to display captions exactly as you requested. Please ensure you type the code carefully whenever you want a caption to appear in place of an image.
Thank you for your time and cooperation.
Best regards,
Dhanush
Dear @gertruda ,
I hope you’re doing great.
I wanted to follow up since I haven’t heard back from you for a while. Could you please confirm whether the PHP snippet shared earlier was added to your child theme’s functions.php file or to a custom functionality plugin?
(While it can also be added to the plugin’s own functions.php, it’s not recommended because the changes may be lost when the plugin is updated.)
If you didn’t see my earlier message here, I can share the code again for convenience.
If the snippet has been added and the issue is resolved, please let me know — I’ll mark this thread as resolved for now. You can reopen it anytime if you need more help.
Thank you for your time and cooperation.
Best regards,
Dhanush
Hello
Thanks for the help, but I found another solution and made changes to the plugin code.