# Customize the theme with code snippets

Beside using a child theme to modify themes, you can also use plugins to achieve it. It is easier than using the child theme, but it has some limited. You should use plugins when your customizations are simple.

### Insert scripts to header and footer. <a href="#insert-scripts-to-header-and-footer" id="insert-scripts-to-header-and-footer"></a>

Sometimes you need to insert some kind of code to your website. It is most likley a web analytics code like Google Analytics or may be social media script or some CSS stylesheet or may be Custom fonts. You can use this plugin:

[Header and Footer Scripts](https://wordpress.org/plugins/header-and-footer-scripts/)

You can use this plugin to:

* To insert CSS and JavaScript codes to `<head>` or before `</body>`.
* To insert code to `<head>` of any single page, post, or custom post type.

{% hint style="danger" %}
This plugin can't be used to insert PHP codes.
{% endhint %}

### Add PHP code snippets <a href="#add-php-code-snippets" id="add-php-code-snippets"></a>

Most tutorials tell you to add snippet code to the `functions.php` file of a child theme (we do too), but if you don't want to do it, you can use this plugin:

[Code Snippets](https://wordpress.org/plugins/code-snippets/)

This plugin provides graphical interface, similar to the Plugins menu, for managing snippets. Snippets can can be activated and deactivated, just like plugins.


---

# 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://craftmonkey.gitbook.io/noelle-documentation/customize-theme/customize-the-theme-with-code-snippets.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.
