HD Quiz

Need to send invoices?
Check out my new WordPress plugin HDInvoice
Limited time launch sale

Is there any way to have quizes not only on singulars?

Published: March 5, 2024
Support status: closed

Hey team
We have the structure of our website that category/taxonomy also has a lot of text and we would like to have quizes on those. But apparently the code below doesn’t allow to have it.
if (!is_singular() && HDQ_REDIRECT) { // if we are on a category, search, or home blog page // replace quiz with direct link to post or page hdq_print_quiz_in_loop(); $buildQuiz = false; } else { ... }
Is there any way to fix it (at least remove the condition for now) from your end? As a solution for later, you can add checkboxes to the backend where quizes supposed to be shown.

Thanks in advance for fast fixing

thread author: Oleksii

Hi Oleksii,
only one quiz can load per page. This is why those checks are there to see if we are in a loop or category page, and if we are, instead of loading a quiz we link to the post/page directly.

If you want to disable this behaviour, add the following definition to your theme’s functions.php file.

define('HDQ_REDIRECT', false);

Just note that this may cause issues if your category page has more than one quiz showing at a time.

05 March 2024 — 11:10 support admin - Dylan

Thank you for the hint
That also works for our website.
You can close the ticket.

05 March 2024 — 11:32 thread author - Oleksii

Another question has been raised.
When performing quiz with pagination (next question comes only when you click Next button) is there any way to DEACTIVATE scrolling to the top of question?

06 March 2024 — 07:42 thread author - Oleksii

Respond to thread

This thread has been closed / marked as resolved.
You can reply to this thread, but it might be better to start a new thread if you need help

You can also upload images to imgur and paste the links here. Just make sure that your images don't include any sensitive information.