Hi namelyjt,
both short codes and embeds (such as YouTube) should work out of the gate in both the Results and Extra text sections. Just note that for YouTube, you don’t need to add any code. You can actually just paste the URL in and your site will automatically create the embed – this is a native WordPress feature.
If this isn’t working for you, then there are only two possible reasons that I can think of.
- Page caching. If you are using a caching plugin, try clearing your site caches. It’s possible that they are not including the required WordPress embed coding
- Also check the settings in whatever cache plugin you are using. You might have some setting that affects embeds by lazy loading them or something. It’s possible that HD Quiz is correctly printing the content you want, but due to your cache plugin, it isn’t loading when revealed.
- There might be something else on your site (either theme or another plugin) that is modifying default WordPress functionality and has broken embeds for you as a side effect.
Something you can do that MIGHT help if #2 is the issue for you is to go to the HD Quiz settings page and disable “Replace the_content filter for quizzes”. If something else on your site is modifying some of your content filters, disabling this feature *might* bypass the problem and help.
If none of the above works, then all I can do is to recommend the standard WordPress debug steps of temporarily switching themes and deactivating all plugins (other than HD Quiz) to see if that works. You can then re-enable one by one until you find the thing that is breaking it for you.
Thanks! I’ll try your suggestions.
Well, I’m as confused as ever. The only plugin that I have other than HD Quiz and Save Results Light is a syntax highlighter, which I disabled. That had no effect.
I disabled Replace the_content filter for quizzes as you suggested, and it didn’t seem to have an effect.
But I added a New question and when I did that and added a YouTube link, it showed up as an embedded video, something that had never happened previously. But when I went to test the quiz, when I actually got to the end, the video showed up as a link, not as an embed.
I created a test page with a one question test quiz that demonstrates the problem in case you want to look at it. Once again, in the build stage, the video shows up as an embed, but in running the quiz, the video shows up as a link. Perhaps it will behave differently for you.
https://namelyjt.com/quiz-test/
I’m just scratching my head…
What if you change themes?
Even using the theme preview should be enough to test. It sounds to me like whatever theme you are using is not compatible with embeds and or is modifying the previously mentioned filters.
Thanks for your help, but I’ve spent so much effort in getting my theme just the way I want it, I’m afraid to tinker with it in any way for fear I’ll never get it back again.
I guess if the problem is the theme, I’ll just have to live with it.
Thanks again.