Sample screenshots below.
Course CPT item:
Footer CPT item:
Course 1 on the front end:
Another course, Course 2 whose Footer field has been set to Footer 2:
We shall set this up such that single course pages that don't have a footer set and all other pages of the site (like the homepage, blog posts index) will output the field values from a "Default Footer".
Install and activate Meta Box and Meta Box AIO plugins.
Create Course and Footer CPTs.
Create a field group for the Course CPT having a Post type of field set to
footer post type.
Create your post-specific footers.
Make sure to also create a default footer.
Edit your Course CPT entries and select the corresponding footers.
Edit your Footer template with Bricks and paste this JSON.
In the outer loop, we are querying the Footers. But this is going to pull all the
footer CPT items. In the next step, we shall limit this to only the footer that has been set (if set) for the current single course (when on a single course page) or the default footer.
In the inner loop, the query is set to "Footer Links" - a custom query type that we are going to create in the next step. Since this does not exist yet, after doing Step 5 you may have to come back and ensure that the query type is set correctly.
The heading text inside the inner loop is set to:
and the Basic Text element's text set to:
This is a BricksLabs Pro tutorial.
For full access login below or create your BricksLabs Pro account