Image on the ‘QUIZ START’ page
Is it possible to insert an image that only appears on the page with the ‘QUIZ START’ button?
Images that I insert using the shortcode appear on all pages and sometimes give away an answer.
Hi Thorsten,
can you explain further what you mean by “only appears on the page with the ‘QUIZ START’ button”?
Like, do you want to add an image to the button, or have it appear before or after the button?
If you want to add an image after the quiz start button, would adding a new question with the type “Question as title” and setting a “Question featured image” work for you? If you drag the question to the top so that it’s first, then this title will appear with your selected featured image as soon as the quiz starts.
The image should appear above the ‘Start Quiz’ button, as in my current quiz (see link).
However, the image should not appear on the question pages.
So you want to have an image above the “quiz start” button, but then hide that image once the user actually starts the quiz?
If you can provide that link, I can take a look and provide instructions.
https://welliathome.de/quiz-futterpflanzen/
Button “Quiz starten” (= “Start Quiz”)
See example code here
This code can be added to your theme’s functions.php file. AWAYS BACKUP the file before modifying!!!!!
In order for this to work, all you have to do is make sure that the image you want to hide has a classname of hdq_before_image
What this code does is check to see if the start button was clicked on, and then hides any element with the classname of hdq_before_image.
If you are using the native Gutenberg editor, this can be done by selecting the image, then “advanced” from the sidebar. If you are using a different editor, you’ll need to figure out how to do it yourself.
Perhaps a quiz cover image would be a good idea for the next update. 😉
Unfortunately, my Code Snippets plugin reports an error when I paste the code.
I tested the code, so it 100% works. The code is PHP and also prints JavaScript. Perhaps your code snippet plugin gets confused by that. Either way, if you add the code to your theme’s `functions.php` file it will work.
This thread has either been marked as complete or has been automatically closed due to inactivity. Please consider opening a new support thread for help.