> For the complete documentation index, see [llms.txt](https://docs.milingona.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.milingona.co/bakery-1/how-to-1/where-do-i-add-my-custom-php-code.md).

# Where do I add my custom PHP code?

#### Inside the child theme

The best way to add your custom PHP code (small snippets) is in the `functions.php` file of your child theme. The functions file behaves like a WordPress Plugin, adding features and functionality to a WordPress site through PHP code. You can use it to call native PHP functions, WordPress functions, or to define your own functions.

* bakery-child
  * functions.php

Do not under any circumstance add PHP code in the  `functions.php` file of the parent theme! To keep your additions when you update the theme,  **always** use the `functions.php` file of your child theme.

#### By plugin

Alternatively, simply use a "functionality" plugin such as the [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin to manage your custom PHP snippets.
