Totally possible! Add the following to your theme’s functions.php file and remember to make a backup of the file first in case you make a mistake.
// create new question option "Featured Media"
function hdq_adriandambrine_add_question_meta($fields)
{
$field = array();
$field["type"] = "editor";
$field["name"] = "hdq_featured_media";
$field["label"] = "Featured Media";
array_push($fields["extra"], $field);
return $fields;
}
add_action("hdq_add_question_meta", "hdq_adriandambrine_add_question_meta");
// print out the content if exists
function hdq_adriandambrine_after_featured_image($question)
{
if (isset($question["hdq_featured_media"])) {
echo apply_filters('the_content', $question["hdq_featured_media"]["value"]);
}
}
add_action("hdq_after_featured_image", "hdq_adriandambrine_after_featured_image");What the code will do is add a new option/setting to each question under the “extra” tab (same location as where you set the featured image) called “Featured Media”.
In this new section, you can add any content you want and it will appear where the featured image does for each question. Using this you can upload and embed an audio or video player, a youtube video, an additional image – anything!
The only thing to note is that the reason this is not something that is just built into HD Quiz by default is because there is no way for me to be able to style any embedded players you add without ensuring that there is no conflict with your theme. So how an embedded audio player looks will be fully dependent on your theme.
