This members-only tutorial provides the steps to develop an Oxygen template for single pages of a "service" Custom Post Type with an attached "faq" ACF Pro Repeater field automatically appearing with expand-collapse functionality using jQuery Collapse. Backend: Frontend:
Step 1Install and activate Custom Post Type UI. Go to CPT UI > Add/Edit Post Types. Add
servicepost type like so: Click "Add Post Type" button.
Step 2Install and activate Advanced Custom Fields Pro. Go to Custom Fields > Tools and import this field group. This should add a "FAQ" field group having
questions_and_answersrepeater field with
answersub fields. Ensure that the field group is attached to the service CPT.
Step 3Go to Services > Add New. Add your service post type entries with Title, Content, Featured image and as many Question and Answer pairs as you want for each.
Step 4Go to Oxygen > Templates. Add a new template named say, "Service CPT Single". Set it to inherit from your Main template having the site header and footer. Apply it to Singular > Services with a priority of 1 (or more depending on how your template for sitewide single entries is setup). Edit it with Oxygen.
Step 5Add a Section and add your desired elements like the Post Title, Featured image and Content. Let's loop through the
questions_and_answersfield and output the
answersub fields for each row. Add a Code Block. Go to Advanced > Size & Spacing and set Width to 100%. PHP & HTML:
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $499 one-time).
Already a member? Log in below or here.