Title: Creating a custom function?
Last modified: August 18, 2016

---

# Creating a custom function?

 *  [willy](https://wordpress.org/support/users/willy/)
 * (@willy)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/creating-a-custom-function/)
 * I’m converting an existing php page to a wordpress page. On the existing page,
   I have 2 units of dynamic html based on the values of a cookie. I have existing
   code that can open / process this.
 * My question: What is the proper way to integrate custom code into a WP template.
   Do i need to make a function call for it within the worpdress umbrella, or can
   I just type my php code in the template?
 * Thanks & happy new year!

Viewing 1 replies (of 1 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/creating-a-custom-function/#post-312169)
 * If using WordPress 2.0 and you prefer to separate code from design in your templates,
   you can add a functions.php file to your theme and place any custom PHP functions
   in there. WordPress will include the file automatically.
 * But hey, it’s your site, your WordPress. If the code is only to be used within
   the confines of your blog, do it however works best for you.

Viewing 1 replies (of 1 total)

The topic ‘Creating a custom function?’ is closed to new replies.

## Tags

 * [Coding](https://wordpress.org/support/topic-tag/coding/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * Last activity: [20 years, 3 months ago](https://wordpress.org/support/topic/creating-a-custom-function/#post-312169)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
