How to create a simple quiz in WordPress[without plugin]?

Hello, guys this will be a short post on How to create a quiz in WordPress without using any plugins.

A quiz combines the following shortcodes:

[[quiz] [/quiz]]  This triggers the overall Quiz shortcode. [[question] [/question]] This code indicates the question being asked. [[answer] [/answer]] This code indicates a correct answer. You can use as many of them as you like. [[wrong] [/wrong]] This code indicates an incorrect answer. You can also use as many of them as you like. [[explanation] [/explanation]] This code should be placed within either an answer or a wrong shortcode, and it indicates that the option should expand into an explanation of why it’s correct or incorrect.

Just copy and paste the below code wherever you want and change the required fields.



[question]Insert question here [/question]

[answer]Insert correct answer here [/answer]

[wrong]Insert wrong answer here [/wrong]

[wrong]Insert wrong answer here [explanation]Add additional information or an explanation for why it’s wrong here[/explanation] [/wrong]



Best plugins for show quiz in WordPress—

  1. Quiz Master Nexth(free)
  2. Gravity Forms(paid)

Let’s test your WordPress Knowledge—

Below is a list of 5 simple questions for WP Beginner. Each correct answer fetches one mark, comment below what you scored. I will be happy to share!

[quiz] [question]Q1 How can I add a sidebar to my WordPress theme?[/question] [answer]In the WordPress widget section[explanation]👍 correct ![/explanation][/answer] [wrong]In the WordPress site settings section[explanation]👎 worng [/explanation][/wrong] [wrong]By installing sidebar plugin[explanation]👎 wrong [/explanation][/wrong] [wrong]Inside the theme template[explanation] 👎wrong [/explanation][/wrong] [/quiz] [quiz] [question]Q2 Where can I find wp_config.php file? [/question] [wrong] It is located inside WordPress admin folder[explanation]👎 wrong [/explanation][/wrong] [answer]It is stored in the WordPress root directory of your web server[explanation] 👍correct ![/explanation] [/answer] [wrong] It is located inside WordPress database[explanation]👎 wrong [/explanation][/wrong] [wrong] In my WordPress theme folder[explanation]👎 wrong [/explanation][/wrong] [/quiz] [quiz] [question]Q3 What database does WP use? [/question] [wrong]Notes[explanation]👎wrong[/explanation][/wrong] [wrong]Oracle[explanation]👎 wrong[/explanation][/wrong] [wrong]PostgreSQL[explanation]👎 wrong[/explanation][/wrong] [answer]MySQL[explanation] 👍correct ![/explanation][/answer] [/quiz] [quiz] [question]Q4 What programing language is WordPress written in? [/question] [wrong]Python[explanation]👎 wrong[/explanation][/wrong] [wrong]Pearl[explanation]👎 wrong[/explanation][/wrong] [answer]PHP[explanation]👍 correct ![/explanation][/answer] [wrong]C[explanation]👎 wrong[/explanation][/wrong] [/quiz] [quiz] [question]Q5 To access your admin area, you need to put the following URL [/question] [wrong]/wp-wordpress[explanation]👎 wrong[/explanation][/wrong] [wrong]/wp-login[explanation] 👎wrong[/explanation][/wrong] [answer]/wp-admin[explanation]👍 correct ![/explanation][/answer] [wrong]/admin[explanation]👎wrong[/explanation][/wrong] [/quiz]

1 thought on “How to create a simple quiz in WordPress[without plugin]?”

Leave a Comment