Q. How can we implement the equivalent of the Twenty Seventeen Theme Options?
In the Twenty Seventeen theme there are Theme Options which enable you to choose the page to be displayed for each of four Front Page sections.
The pages for the live front page are shown in the image.
How do we reproduce this in the template for the Front page?
A.
- Create a template part for each section
eg front page section 1 content - For each template part, use the Advanced Query Loop block to specify the page to be included.
- Optionally use a full height Cover block with Fixed background to appear before the scrolling content.
- For the Blog section change the query loop to display the most recent posts.
Notes
- The Cover block does not support displaying a fixed background featured image. You have to specify the image you want.
- If you set a gradient on the Cover block, but don’t select an image then this will be displayed at the height you choose.
Pros and Cons
- This is more complicated than theme options
- But it’s a lot more flexible
- You can choose what you want displayed in each section.
- You can integrate other patterns and template parts as required.
- Switching between One and Two Columns isn’t as easy.
- There’s no PHP code involved.

