Dear Team,
I feel a bit lost with a problem.
I have a custom post type for Quizzes that I created using WordPress’ Metabox API & not ACF. It is like a plugin.
Now when I create a quiz, with a question, and options and marking the correct answer, how do I map the display of the quiz to a CPT Template?
If anyone else has tried something like this, am all ears for solutions!
Hi Anamaria,
Yes, the cpt appears in the cloud templates and I assigned a template too. But in the template, only the “Title” & “Description” appears – the data from the Metabox doesn’t. This data is the quiz question and options.
Also, none of my custom posts open the Gutenberg Editor.
Where am I going wrong?
Here’s a link to the video! I’d of course be working on the custom post type a bit more — am in the initial stages only, so your help is appreciated!
Hi,
Can you send the link to the plugin?
I thought you created the quiz in the content, but these are custom fields, which is why they’re not displayed in the template. They will need to be added, but to be able to assist you, I need the plugin to attempt to create a test.
Thank you!
Hey! Sure – but how do I send it? I made it myself (and it isn’t perfect yet) — but can email you access to the WP backend / Siteground whatever you prefer. Sorry am also trying this for the first time as none of the plugins I’ve seen are helpful to my purpose.
Hi,
I think that you may use a plugin created for this and then to add it to the content https://www.wpbeginner.com/showcase/best-quiz-plugins-for-wordpress/
Thank you!
I’m not sure I follow – I don’t want to use any of the plugins listed here because my expectations / needs are specific. I have tested some of these including HD Quiz and don’t need these.
Could you please guide me on making sure the question loads into the CPT template or my normal single-post template? I would prefer that the quiz loads into the single-post template like a usual post.
Hi @Anamaria,
Sorry for my late response – I was still testing it on my actual site and not a staging one, so unfortunately I was a bit stuck. It turns out my trial wasn’t working and your instructions here to use CPT-ACF might be a better solution.
I have read through the ACF Pro documentation, and I feel it might be a better idea for me to create a quiz using repeater fields etc. and then map it to a template provided by you all.
Would you know of use-case examples such as these?
Thank you in advance!
Hi,
Unfortunately, this type of acf is not implemented in the theme, but you can use the shortcode of acf to display it using column text https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/
Thank you!
Hi @anamaria – thanks for sharing the link but it seems the good option is to add the code to a page-template. Somehow, adding a code to functions.php and generating a shortcode is just not giving out the right solution in case of ACF’s nested repeater fields.
How can I add the code to a blank template assigned to my CPT?
Hi @Anamaria, I managed to do this and generate a shortcode that I can add to any page / post to display the quiz (not the front end creation for it yet). However, I’ve added it to my functions.php code. I don’t use a child theme yet.
Please suggest how I can update the theme without losing this. Should I move to a staging site, create a child theme and then update? How to copy everything to a child theme?
Hello,
You can create a child theme or, after every update, add the code to the functions file again https://forum.tagdiv.com/the-child-theme-support-tutorial/
Thank you!