Title: Activate the timer
Last modified: April 16, 2024

---

# Activate the timer

 *  Resolved [mehdis6211](https://wordpress.org/support/users/mehdis6211/)
 * (@mehdis6211)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/activate-the-timer/)
 * Hello
   Thank you very much for the pluginSorry, is there a way to have the timer
   active when the user enters the test without hitting the start test button?
 * my site
 * [https://test-drive.ir/%d8%a2%d8%b2%d9%85%d9%88%d9%86-%d8%a2%db%8c%db%8c%d9%86-%d9%86%d8%a7%d9%85%d9%87-%d8%b1%d8%a7%d9%86%d9%86%d8%af%da%af%db%8c-%d8%a7%d8%b5%d9%84%db%8c-1/](https://test-drive.ir/%d8%a2%d8%b2%d9%85%d9%88%d9%86-%d8%a2%db%8c%db%8c%d9%86-%d9%86%d8%a7%d9%85%d9%87-%d8%b1%d8%a7%d9%86%d9%86%d8%af%da%af%db%8c-%d8%a7%d8%b5%d9%84%db%8c-1/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Harmonic Design](https://wordpress.org/support/users/harmonic_design/)
 * (@harmonic_design)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/activate-the-timer/#post-17691150)
 * Hi mehdis6211,
   the timer hides the quiz behind a “start quiz” button for good
   reasons, so I strongly recommend leaving it — especially on your site. It will
   give your users a better experience.
 * For example, your own site has intro copy letting users know about the quiz and
   giving instructions. And then scrolling down, there is a giant image that you
   have to scroll past. And then below the image there is the quiz. But wait, I 
   can’t select an answer yet because there is a newsletter popup that I have to
   close first. Now imagine that the quiz timer was running as soon as the page 
   loads.
 * The Start Quiz button is there to avoid all of the above. If the user wants to
   read your instructions, they can do so without the pressure of a countdown timer.
   If they want to subscribe to your newsletter, then they can do so without running
   out of time to complete the quiz. And so on. Hope this makes sense!
 * HOWEVER, if you don’t care about any of the above and want the timer to start
   immediately as soon as your page loads, let me know. I can provide you with code
   you can add to your theme that will automatically “click” the Start Quiz button
   as soon as it’s ready.
 *  Thread Starter [mehdis6211](https://wordpress.org/support/users/mehdis6211/)
 * (@mehdis6211)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/activate-the-timer/#post-17691171)
 * Thanks for the help
   I had already activated the button to start the test, unfortunately,
   the visits to my site decreased, most of the users were sending messages and 
   could not start the test.Please post the code if possibleThanks
 *  Plugin Author [Harmonic Design](https://wordpress.org/support/users/harmonic_design/)
 * (@harmonic_design)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/activate-the-timer/#post-17691203)
 * Add the following to your theme’s `functions.php` file. BACKUP THE FILE FIRST.
 *     ```wp-block-code
       function hdq_mehdis6211_init($data)
       {	
       	array_push($data->hdq_init, "hdq_mehdis6211_after");
       	return $data;
       }
       add_action("hdq_init", "hdq_mehdis6211_init");
   
       function hdq_mehdis6211_after()
       {
       	?>
       <script>
       function hdq_mehdis6211_after(){
       	const sel = document.getElementsByClassName("hdq_quiz_start");
       	if(sel.length == 0){
       		return;
       	}
       	sel[0].click();
       }
       </script>
       	<?php
       }
       add_action("hdq_after", "hdq_mehdis6211_after");
       ```
   
 * The above function does two things. First, it tells HD Quiz to run a custom JavaScript
   function once HD Quiz has loaded. Second, it prints the custom JavaScript function
   after each quiz. The JS function simply clicks on the start quiz button automatically.
 *  Thread Starter [mehdis6211](https://wordpress.org/support/users/mehdis6211/)
 * (@mehdis6211)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/activate-the-timer/#post-17692075)
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Activate the timer’ is closed to new replies.

 * ![](https://ps.w.org/hd-quiz/assets/icon-256X256.gif?rev=2936040)
 * [HD Quiz](https://wordpress.org/plugins/hd-quiz/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hd-quiz/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hd-quiz/)
 * [Active Topics](https://wordpress.org/support/plugin/hd-quiz/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hd-quiz/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hd-quiz/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [mehdis6211](https://wordpress.org/support/users/mehdis6211/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/activate-the-timer/#post-17692075)
 * Status: resolved