# How to add your own code to our themes

In some cases you might want to add your own code, as such as advertising or analytics tracking. Advanced users might want to adjust our native CSS or add their own markup.

### Adding code to \<head>

Our Milk and H2O theme control panels can add global \<head> code through the ACP.

1. In ACP → Extensions → Theme Settings
2. Enter your code into Global \<head> Code
3. Submit

***

### Adding sidebar code

See:

* Milk: Sidebar options (link needed)
* H2O: Sidebar options (link needed)

***

### Adding new code by manual editing

If you are only making a few small changes, you can add your own code by modifying the theme's HTML and CSS files.

These are located in:

```
yourforum.com/styles/your_theme/theme/
yourforum.com/styles/your_theme/template/
```

See: [How to edit code files](/getting-started/how-to-edit-code-files.md)

{% hint style="info" %}
Using this method, you might lose the changes you make when [updating the theme](/getting-started/how-to-update-theme-to-new-version.md).
{% endhint %}

***

### Adding new code in other locations

It is recommended to check phpBB's official [extension database](https://web.archive.org/web/20230604062106/https://www.phpbb.com/customise/db/extensions-36), as the functionality you're looking for might already be available as a pre-packaged extension.&#x20;

For larger and more substantial changes, send us a message. We'll discuss the scope of the changes you'd like to make, and suggest the best method of implementation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.planetstyles.net/getting-started/how-to-add-your-own-code-to-our-themes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
