> For the complete documentation index, see [llms.txt](https://docs.uichemy.com/llms.txt).
> Use it to discover all available pages before exploring further.

# Assigning Conditions

How templates get matched to pages: template type, target, and display conditions are three separate mechanisms, and not every template type uses all three.


Where a template appears depends on up to three things, and which ones apply depends on the template type:

1. **Type**, the 8 kinds (Header, Footer, Single, Archive, Single Product, Products Archive, Search Results, 404 Page).
2. **Target**, for Single and Archive templates only, a broader category chosen when you create the template (for example, which post type, or which taxonomy).
3. **Conditions**, Include/Exclude rules for finer control, available on Header, Footer templates directly, and as a tie-break within Single/Archive's target.

<Callout kind="warning">
Search Results, 404 Page, Single Product, and Products Archive templates don't use conditions at all. If you create more than one template of the same type, the most recently activated one wins, there's no rule-based scoping for these four types.
</Callout>

### Opening Conditions

From **UiChemy → Theme Builder** (Grid view), click **Conditions** on a Header, Footer, Single, or Archive template's card. You can also set conditions immediately after saving a template for the first time.

This opens the **Display conditions** popup: "Choose where '[Template Name]' appears. Rules stack, an Exclude always wins."

### Adding a Condition

1. Click **+ Add condition**.
2. Choose **Include** or **Exclude**.
3. Select the **scope** from the dropdown.
4. If the scope needs a specific target (a post, page, or category), select it in the second field.
5. Click **Save Conditions**.

<Callout kind="tip">
A Header or Footer template with no conditions set isn't invisible, it defaults to matching the **entire site**. Add conditions to narrow it, not to turn it on.
</Callout>

### Include vs Exclude

| Type | Effect |
|---|---|
| Include | Show the template on the selected pages |
| Exclude | Hide the template on the selected pages, even if an include condition would match |

You can combine includes and excludes on the same template for fine-grained control.

### Condition Scopes (Header, Footer, and Within Single/Archive)

| Scope | What it targets |
|---|---|
| Entire Website | Every page and post on the site |
| All of a post type | Every post or page of a type you pick (for example, all Posts, or all Pages) |
| In a taxonomy term | Content in a chosen taxonomy term (for example, a category or tag) |
| By author | Content published by a specific author |
| Specific page / post | One exact page or post |

<Callout kind="info">
"Author Archive" and "Date Archive" aren't condition scopes, they're Archive **targets** you pick when creating the template, see [Archive & Search Templates](/uichemy-plugin/theme-builder/archive-templates). There's no "date" or "404" condition type.
</Callout>

<Callout kind="warning">
This table covers the top-level scope options confirmed from the current UI. Each scope (except Entire Website) reveals a second field to narrow it further, for example, which post type, which taxonomy term, which author, or which exact page, but the exact options in that second field haven't been verified yet.
</Callout>

### Examples

**Global header except on checkout:**

1. Add **Include → Entire Website**.
2. Add **Exclude → Specific page / post →** your Checkout page.

**A different header for the blog:**

1. Create two Header templates.
2. General header: **Include → Entire Website**.
3. Blog header: **Include → All of a post type →** Posts (more specific, wins on post pages).

### Condition Priority

For Header and Footer templates, and as a tie-break inside a Single or Archive template's target, **the more specific condition wins**. A template assigned to a specific post takes priority over one assigned to all posts.

For **Search Results, 404 Page, Single Product, and Products Archive** templates, there's no specificity system, if you have more than one active template of that type, the one you activated most recently is the one that shows.

<Callout kind="warning">
If you already have a header or footer active in Elementor Pro or Nexter, don't also activate a UiChemy header/footer, it will create a duplicate on the front end. The Theme Builder shows a notice if another theme builder is detected, but it does not automatically stand down, you have to avoid activating both yourself.
</Callout>

### Frequently Asked Questions

<ExpandableGroup>
  <Expandable title="What happens if I don't add any conditions to a header or footer?" default-open="false">
    It shows on the **entire site**. Add conditions only to narrow where it appears.
  </Expandable>

  <Expandable title="Which wins, Include or Exclude?" default-open="false">
    **Exclude** always wins. If a page matches both an Include and an Exclude rule on the same template, the template is hidden there.
  </Expandable>

  <Expandable title="Why can't I add conditions to my 404 or Search Results template?" default-open="false">
    Search Results, 404 Page, Single Product, and Products Archive templates don't use conditions. If you have more than one active, the one you activated most recently is the one that shows.
  </Expandable>
</ExpandableGroup>

### Related

<Columns cols={2}>
  <Card title="Creating Templates" href="/uichemy-plugin/theme-builder/creating-templates">
    Build the template you're about to assign conditions to.
  </Card>
  <Card title="Theme Builder Overview" href="/uichemy-plugin/theme-builder/overview">
    See the full picture of what Theme Builder can do.
  </Card>
  <Card title="Single Templates" href="/uichemy-plugin/theme-builder/single-templates">
    See a target-plus-conditions example in practice.
  </Card>
  <Card title="Archive & Search Templates" href="/uichemy-plugin/theme-builder/archive-templates">
    See another target-plus-conditions example.
  </Card>
</Columns>
