Support » Plugin: HD Quiz » How to add bottom “Previous Question” on Paginate mode

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Harmonic Design


    This is an upcoming feature actually 🙂

    However, if you add the following code to your theme’s function.php file, you will almost get this with perfect functionality. The only thing this won’t currently do is auto-scroll to the first visible question when you select the “back” button.

    function hdq_nattapongae1()
    { ?>
    	jQuery(".hdq_quiz").on("click", ".hdq_prev_button", function(){
    }, 2000)
    function hdq_create_prev_buttons(){
    	let data = '<div class="hdq_prev_button hdq_button" style = "margin-right: 1rem">BACK</div>';
    	let hdq_pagination_areas = document.getElementsByClassName("hdq_next_button");
    	for(let i = 1; i < hdq_pagination_areas.length; i++){
    		hdq_pagination_areas[i].insertAdjacentHTML("beforebegin", data);
    function hdq_prev_click(){
    	let hdq_prev_p = jQuery(".hdq_break_prev_2").prevAll(".hdq_jPaginate").first();
    	if (typeof hdq_prev_p[0] != "undefined") {
    	} else {
    	jPage = parseInt(jPage - 1);
    <?php }
    add_action("hdq_before", "hdq_nattapongae1");

    The above code essentially does two things. First, it creates a new “BACK” button next to each “NEXT” button except the first (you can’t go back id you’re already on the first page after all!). Second, it adds in logic to figure out which questions to hide and show. It’s a little dirty but gets the job done in my own testing.

    Please let me know if you need further help with this

    • This reply was modified 1 month, 3 weeks ago by Harmonic Design. Reason: modified code to remove backquotes since I forgot this uses markup


    Thank You.

    Now i get its.

    see pic below;

    Let test;

    I waiting your upcoming feature ^^. Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.