How Do I Create a Multiple Choice Question in WordPress?

Creating a multiple choice question in WordPress is easy. First, create a new file in your theme’s functions.

php file. Then, add the following code to the file:.

// Multiple Choice Question function my_mcl_question() { $question = new WPBakeryShortcode(‘[mcl question]’); $question->set_option(‘container’, ‘div’); $question->set_option(‘question_markup’, ‘‘); $question->set_option(‘answer_markup’, ‘‘); return $question; } add_action(‘init’, ‘my_mcl_question’);

Next, create a new file in your theme’s style.css file. Then, add the following code to the file:.question { font-size:11px; line-height:16px; color:#666; }

Finally, add the following code to your theme’s functions.php file:

// Load the my_mcl_question function my_mcl_question();

Now, you’re ready to create your question. To do this, you’ll need to create a new file in your theme’s functions.php file and add the following code to the file:

Next, you’ll need to create a new file in your theme’s content folder and name it question.php. Then, add the following code to the file:



Multiple Choice Question

set_option(‘container’, ‘div’); $question->set_option(‘question_markup’, ‘‘); $question->set_option(‘answer_markup’, ‘‘); // Add the question to the DOM $question->add_action(‘init’, ‘my_mcl_question’); ?>

Now, you’re ready to create your questions.php file and add the following code to the file:

Next, you’ll need to create a new file in your theme’s content folder and name it questions.question { font-size:11px; line-height:16px; color:#666; }


Multiple Choice Questions

set_option(‘container’, ‘div’); $question->set_option(‘question_markup’, ‘‘); $question->set_option(‘answer_markup’, ‘‘); // Add the question to the DOM $question->add_action(‘init’, ‘my_mcl_question’); ?>

Now, you’re ready to create your answers.php file and add the following code to the file:

Next, you’ll need to create a new file in your theme’s content folder and name it answers. Then, add the following code to the file: