> For the complete documentation index, see [llms.txt](https://docs.kaliumtheme.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kaliumtheme.com/getting-started/theme-settings/template-parts.md).

# Template Parts Settings

Switch the Template Parts system on or off, and control how Snippets are stored and guarded.

**Kalium -> Settings -> Template Parts** holds three switches. The first decides whether the whole Template Parts system exists; the other two are about Snippets.

<figure><img src="https://2905187046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1O25QgF7NUwiK2Ek4ro8%2Fuploads%2FfqOGNqwN4axRDKkvvjgl%2Ftheme-settings.jpg?alt=media&amp;token=68a82284-27fb-4104-9e1e-7b488bcdb072" alt=""><figcaption></figcaption></figure>

***

### Template Parts

**On by default.**

This enables the system that lets you create custom sections, replace headers, footers and whole pages, build popups, and run code snippets.

Turning it **off**:

* Removes the **Kalium -> Template Parts** menu
* Stops every template part from being applied
* Stops every snippet from running
* Removes the **Content Section** element from Elementor and the block editor

**Nothing is deleted.** Your template parts stay in the database exactly as they were and come back the moment you switch it on again.

{% hint style="info" %}
If the **Kalium -> Template Parts** menu is missing from your dashboard, this setting is the first place to look. The second is **Hide Template Parts** under [White Label](/getting-started/theme-settings/white-label.md).
{% endhint %}

{% content-ref url="/pages/kn7r1usCJpmQ1YlE4r8E" %}
[What are Template Parts?](/template-parts/what-are-template-parts.md)
{% endcontent-ref %}

***

### Snippet Files

**On by default.**

With this on, each snippet is saved to a file in `wp-content/uploads/kalium-snippets/` as well as to the database. There are real benefits to this:

* **PHP snippets run from the file**, so your server caches them like any other PHP file
* **CSS and JavaScript snippets gain the Enqueue as File option**, letting browsers cache them across page views
* When something fails, WordPress points at the snippet file rather than blaming the theme

The line underneath the setting tells you **whether the folder is writable**. If it isn't, snippets run from the database instead, whatever this switch says, everything still works, you just lose the caching benefits and the **Enqueue as File** option disappears.

Snippet files stay in place while a snippet is disabled or in the trash. They are removed when a snippet is deleted permanently, or when you switch a part's Type away from Snippet.

***

### Snippets Safe Mode

**Off by default.**

This stops **every** snippet from running, without disabling any of them individually. Your snippets stay exactly as they are and start working again the moment you switch it off.

It exists for one situation: a snippet is causing a problem and you need to reach your admin to fix it. Turn Safe Mode on, sort out the snippet, turn it off.

While it's on, a yellow notice appears on the Template Parts screens so you don't forget.

{% hint style="warning" %}
**If a snippet has locked you out of your admin entirely**, you can force Safe Mode on from your site's files. Add this line to `wp-config.php`, above the line that says `/* That's all, stop editing! */`:

```php
define( 'KALIUM_SNIPPETS_SAFE_MODE', true );
```

Remove it once you're done, while it's there, the switch on this screen cannot turn snippets back on.
{% endhint %}

{% content-ref url="/pages/OWbpTF495jUlBNwrNJRk" %}
[When a Snippet Goes Wrong](/template-parts/creating-template-parts/code-snippets/troubleshooting-snippets.md)
{% endcontent-ref %}
