Forum Replies Created

Viewing 15 replies - 1 through 15 (of 1,051 total)
  • Plugin Author Harmonic Design


    Glad it’s working for you!

    Let me know if anything else pops up and please consider leaving a review if you have the time.

    Plugin Author Harmonic Design


    Hi soenke93,
    thank you very much for bringing this to my attention. It was a bug I accidentally introduced in the latest update (I stupidly misnamed a variable).

    I’ve just pushed out an update that should fix this.

    Plugin Author Harmonic Design


    Hi mubasher99,
    you have WP Rocket installed and active on the page. Page caching creates a static version of the page – meaning once cached, WordPress doesn’t even load.

    The reason it is randomly on your desktop is that you are probably logged in, and WP Rocket has a feature where it shows the non-cached version for logged in users.

    If you want randomization on page-load, you will need to exclude those pages from being cached.

    Plugin Author Harmonic Design


    Good idea, I’ll try and think of something fun to make the quizzes even more engaging. Maybe some coloured “sparkles” or something on correct/incorrect answers and quiz completion.

    Plugin Author Harmonic Design


    Hi simosedessa,
    thank you for your review!

    Can you expand on

    may add more features and make it even more attractive, enrich with effects for those who solve the puzzle

    What new features would you like to see? And what do you mean by effects? Do you mean some kind of cool animation when a quiz is completed?

    Plugin Author Harmonic Design


    If you want to change all HD Quiz buttons (including the next and finish buttons) then use the class hdq_button, but if you only want to change the start quiz button then use hdq_quiz_start.

    Your question isn’t really about HD Quiz – it’s about CSS. For this, there are two things you need to know.

    First, use background-color, not background-image.

    Second, CSS uses something called “specificity”. If your site has two conflicting rules for an element, then whichever rule uses the most “specific” selector is the one that will be used.

    In our case, HD Quiz styles buttons with the following selector.

    .hdq_quiz_wrapper .hdq_button

    This is why if you only use .hdq_button nothing happens. Your selector is not specific enough to override the default HD Quiz selector. Luckily, we can tell the browser that this is the rule that should be applied no matter what by using the important attribute. So something like this:

    .hdq_quiz_wrapper .hdq_button {
        background-color: #00454f !important;
        border-radius: 8px;

    Since the default HD Quiz stylings don’t add border-radius to the buttons, you don’t need the !important attribute to override it with that selector.

    Lastly, avoid editing the plugin directly if you can since whenever you update to a new version of HD Quiz, your changes will be overridden. So add this CSS to your theme instead of editing the plugin.

    Forum: Plugins
    In reply to: [HD Quiz] Personality Quiz
    Plugin Author Harmonic Design


    This thread was about creating a personality style quiz, which this plugin is not capable of.

    If you need help creating a normal quiz, please start a new thread and I can help you there.

    Also, where is a tutorial video that might help you get started:

    Forum: Plugins
    In reply to: [HD Quiz] Personality Quiz
    Plugin Author Harmonic Design


    Hi lideregestao2,
    I’m sorry to say that HD Quiz is not the best choice for personality-type quizzes. For this, you’d need a quiz maker that allows for “weighted answers”.

    Plugin Author Harmonic Design


    Hi dt60123,
    yes, the action is called hdq_submit. I recommend taking a look at the save results light addon to see how it works. The addon code is commented to explain what is going on 🙂

    It might be easier for you to edit the addon directly (make sure to set the version number to something high so that you don’t trigger plugin updates).

    The basic flow would be something like this.

    hdq_submit to tell HD Quiz to run a custom function on quiz submit. It will first look for a local javascript function (useful to grab any custom data), and then will send the quiz data to a custom PHP function in the backend where you can parse the data and do whatever you want to it (such as save it to the database).

    You can use hdq_before or hdq_after to add any custom content you want. These are good actions to add either your custom javascript, or even custom form fields.

    Plugin Author Harmonic Design


    Here you go 🙂

    This example does the following.

    1. Adds a new button to the end of a quiz that will load the next quiz. You can add this button anywhere you want. Just take note of…
    2. Adds the Javascript to the end of a quiz. This means that the code will only load on pages that have quizzes. The only thing to note is that this means that where you place the button needs to be ABOVE where this code executes. You can take this code and add it to your footer if that makes more sense for you instead.
    3. Send the current Quiz ID via ajax to the server
    4. On server, accepts the curent quiz ID, and using that, figures out what the “next” quiz to load should be. It then prints that entire quiz and sends back to the client
    5. Now back on our javascript, we add the new quiz to the site, remove the old quiz, reset the quiz settings, and scroll the site back to the top.

    NOTE: You can ignore my “figure out what the next quiz should be” if you want. I just added it in because I thought it was cool haha.

    /* HD Quiz - khanhfe */
    // Load a new quiz via ajax call
    // and figure out what the "next" quiz to load is
    function hdq_khanhfe_after_quiz_content()
    	// this function allows us to add custom content to the end of a quiz
    	// we are using it to add our custom javascript so that the code
    	// only exists on pages that have a quiz on it	
    	<!-- for this example, we are adding in the "next quiz" button here
    	we are using 'div' instead of 'a' so that we do not have to link hijack -->
    	<div id = "hdq_khanhfe_load_new_quiz" title = "Load Next Quiz" aria-role = "button" class = "button">Next Quiz</div>
    		function hdq_khanhfe_load_new_quiz() {
    			document.getElementById("hdq_khanhfe_load_new_quiz").addEventListener("click", function () {
    				/* HDQ.VARS.ajax is preloaded by HD Quiz
    				 * in this example, we are automatically grabbing the "next quiz"
    				 * so replace '' with the quiz id of whatever quiz you want to load
    				 * a specific one instead
    				const data =; // the current quiz ID.
    					type: "POST",
    					data: {
    						action: "hdq_khanhfe_handle_ajax_shortcode",
    						data: data,
    					url: HDQ.VARS.ajax,
    					success: async function (res) {
    						// res will contain all of the HTML for the quiz. We can use this to replace the existing quiz
    						const el = document.getElementsByClassName("hdq_quiz_wrapper")[0];
    						el.insertAdjacentHTML("beforebegin", res);
    						await HDQ.init();
    						hdq_khanhfe_load_new_quiz(); // run this function again to reset the eventListener
    						document.getElementsByClassName("hdq_before")[0].scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest" });
    add_action("hdq_after", "hdq_khanhfe_after_quiz_content");
    function hdq_khanhfe_handle_ajax_shortcode()
    	// this is the function that will be called via the ajax call
    	$current_quiz_id = intval($_POST['data']); // we sent the quiz ID in the ajax call
    	// now we grab as list of ALL quizzes, and loop through them until we find
    	// the quiz whose ID matches current_quiz_id. We can then use this to grab
    	// the next quiz in the list, or reset to the first if we are at the end
        $term_args = array(
        	'hide_empty' => true, // no point loading in an empty quiz!
            'orderby' => 'name', // feel free to change
            'order' => 'ASC', // these to whatever makes sense
        $quizzes = get_terms("quiz", $term_args);
    	$next_quiz_id = 0;
    	for($i = 0; $i < count($quizzes) - 1; $i++){
    		// since we are using quiz count - 1, if we do not find a match
    		// we can assume that the current quiz was the last in the list
    		if($quizzes[$i]->term_id === $current_quiz_id){
    			// get the quiz id for the next quiz in the list
    			$next_quiz_id = $quizzes[$i + 1]->term_id;
    	// if $next_quiz_id is still zero, then the current quiz was probably
    	// the last in the list and we can reset to the first in the list
    	if($next_quiz_id === 0){
    		$next_quiz_id = $quizzes[0]->term_id;
    	define('HDQ_REDIRECT', false); // this disalbes the "is_single" check for AMP pages
    	// cool. we now have the quiz id for the next quiz!
    	echo do_shortcode('[HDquiz quiz = "'.$next_quiz_id.'"]');
    	$data = ob_get_contents();
    	echo $data;
    add_action( 'wp_ajax_nopriv_hdq_khanhfe_handle_ajax_shortcode', 'hdq_khanhfe_handle_ajax_shortcode' );
    add_action( 'wp_ajax_hdq_khanhfe_handle_ajax_shortcode', 'hdq_khanhfe_handle_ajax_shortcode' );
    Plugin Author Harmonic Design


    Off the top of my head, here are my first thoughts on the best way to do this.

    One thing that comes to mind is that you’ll want to “reset” the quiz settings once you’ve loaded in a new quiz. This way we won’t have any conflicts with quiz settings or timers or anything like that. The easiest way is to this is to call HDQ_INIT which will take the initial printed settings and set them to the quiz. Of course, this would only work if your quizzes all use those same settings.

    To load in a new quiz, you are on the right track, but you have a fatal flaw. HD Quiz does not return data, but instead echos it directly. Strictly speaking, this is actually bad practice, but I do it this way to make enqueuing assets (css, js) far more consistent and compatible, while also ensuring that HD Quiz assets only ever load when a quiz is present.

    To get around this, take a look at PHPs ob_flush functions. Using ob_start, ob_get_contents and ob_end_clean you can “capture” the printed content and store it into a variable.


    echo do_shortcode( $content );
    $data = ob_get_contents();

    and then once your ajax call has finished, you can then run HDQ_INIT() to reset the quiz settings.

    Plugin Author Harmonic Design


    Hi khanhfe,
    can you provide any information on what it is you are exactly doing and why you want to use ajax for this? The better I understand your goals, the better I can try and point you in the right direction 🙂

    Plugin Author Harmonic Design


    Hi mubasher99,
    I just took a look at your site and I can see that HD Quiz is correctly adding your adcode after every 5th question.

    So why is it not showing for you? The most likely reason is that you might be using the wrong type of ad. For example, I can see that your site is loading a “bottom bar” style ad – an ad that is FORCED to cover the bottom portion of your site.

    All HD Quiz does is load whatever content you place after every 5th question. It’s up to your adcode to decide on how and where it will actually display these ads.

    So I recommend logging into your adsense account and check what types of ads you have enabled

    Forum: Plugins
    In reply to: [HD Quiz] Facebook APP ID
    Plugin Author Harmonic Design


    Hi thednageek,
    supporting the Facebook APP ID is not something I can really do because A) I am not Facebook, and B) Facebook changes the rules and page layouts all the time.

    This previous thread from last month will hopefully get you pointed in the correct direction though.

    If you go to you will be asked to select an APP type. You can select “none”. Once created, go to Settings -> Basic, and fill out the needed details. Start the Verification process, and once approved you can toggle the App from “In development” to “live”.

    I wish I could provide an actual tutorial on how to do this, but Facebook changes their pages and layouts so often it’s just too hard to keep up. The top three results on Google are all showing the old way – I can’t find any tutorial that actually shows the current layout -.-

    Outside of the above, your best bet is to try and fine an article on how to create an APP ID that is hopefully up date enough to follow.

    Forum: Plugins
    In reply to: [HD Quiz] PHP Fatal error
    Plugin Author Harmonic Design


    Hi theavengers,
    thanks for posting this.

    Looking at those logs – I think the issue is with your site/host and not HD Quiz. The errors are about being unable to open files with the only helpful hint being that there are some memory errors listed.

    I believe the issue is caused by a combination of two things. First, your PHP memory limit is set too low. Second, something on your site (either your theme or other plugins) is using up all of your available PHP memory.

    Think of PHP memory as RAM for your computer. You can only run so many programs at a time.

    What I think is happening is that your PHP memory has run out which means there is no more “memroy” left to load HD Quiz (which is a SUPER small and lightweight plugin BTW). This is why you are seeing errors about not being able to load in files.

    How to fix?
    First thing is to increase your PHP memory. The way to do this will vary depending on your host and setup, but usually, the easiest way is to edit your wp-config.php file found in the WordPress installation folder.
    Here is a good article I found that goes over how to do this:

    Once you have done this, the next thing to do is try and determine why you were running out of memory to begin with! I recommend deactivating any plugins you don’t actually need or use, or even try switching to a “lighter” theme.

Viewing 15 replies - 1 through 15 (of 1,051 total)