The conditional layers tool is a powerful addition that lets you render layers conditionally.
Each condition that is met can render one or many layers.
If no condition is met, the layers contained in the “else” statement will render by default.
It is possible to match condition against :
- Post title
- Post author
- Post category
- Post type
- Any post meta (needs to be specified manually)
- Site domain
- Yoast SEO focus keyword
Comparison operators available :
- Differs from
- Starts with
- Ends with
Possible applications with conditional layers:
- Make a layer have a different color depending on the post category
- Render a different icon depending on the post category
- Create different layouts depending on the date
- Add a special icon to the template if the author is “Julia”
- Make a special background per domain (if you manage multiple sites)
When editing, the editor will show only the layers from the sub condition set when the sub condition is selected or one of its children.