# Functions.php + Define template parts

**URL:** <https://forum.pinegrow.com/t/functions-php-define-template-parts/720>\
**Category:** Pinegrow WP\
**Created:** [February 22, 2017, 12:49pm UTC](https://forum.pinegrow.com/t/functions-php-define-template-parts/720 "2017-02-22T12:49:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierrehansen](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/pierrehansen/32/435_2.png) [@pierrehansen](https://forum.pinegrow.com/u/pierrehansen)\
**Post date:** [February 22, 2017, 12:49pm UTC](https://forum.pinegrow.com/t/functions-php-define-template-parts/720/1 "2017-02-22T12:49:30Z")

</div>

Hello! First I need to say that I’m a Wordpress beginner who lately did his first attempts into creating a Wordpress theme from a HTML website. I recently bought a full licence of Pinegrow Pro WP.

I’m having difficulties to understand how Pinegrow “is mixing” static HTML and Wordpress hooks/actions e.t.c.

What If I want to edit the functions.php after exporting the theme? If I do it in a code editor all these changes can’t be taken back into Pinegrow. So basically I never do have “straight” access to the actual files of my theme in Pinegrow, right? But how can I edit the functions.php within Pinegrow?

When I define a template part from a HTML snippet (like aside) with the “define template part” option, the snippet is being taken out of the Dom when I activate the theme. So actually I could just define it anywhere in the “Pinegrow dome?” and include where I want.

For me Pinegrow is overwhelming but fascinating. The lack of a file explorer is giving me headaches, though.

Any help would be much appreciated!

Thanks!

Best regards,  
Pierre

---

<div class="post-metadata">

**Author:** ![Rob](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/rob/32/9_2.png) [@Rob](https://forum.pinegrow.com/u/Rob)\
**Post date:** [February 22, 2017, 10:42pm UTC](https://forum.pinegrow.com/t/functions-php-define-template-parts/720/2 "2017-02-22T22:42:39Z")

</div>

Hi @pierrehansen have you looked at this article from the docs “[How to add code snippets to the functions.php file](http://docs.pinegrow.com/wordpress-themes/wordpress-tutorials/how-to-add-code-snippets-to-functions-php-file)” and this might also be of help “[Why and How to create a settings page](http://docs.pinegrow.com/wordpress-themes/why-and-how-to-create-a-settings-page)”, I’m not sure how relevant it is to your situation but I thought there’s no harm in sharing it with you.

---

<div class="post-metadata">

**Author:** ![pierrehansen](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/pierrehansen/32/435_2.png) [@pierrehansen](https://forum.pinegrow.com/u/pierrehansen)\
**Post date:** [February 23, 2017, 3:35pm UTC](https://forum.pinegrow.com/t/functions-php-define-template-parts/720/3 "2017-02-23T15:35:32Z")

</div>

Thanks Rob! Im diving into it by reading the tutorials.

One more question/issue:

For example: If I want to register a new post type, I would usually do it in my functions.php. But in Pinegrow I **have** to add the register\_post\_type to an element in my DOM, is that right? That’s a little odd to me and I have to get use to it.

Thanks!  
Pierre

---

<div class="post-metadata">

**Author:** ![Rob](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/rob/32/9_2.png) [@Rob](https://forum.pinegrow.com/u/Rob)\
**Post date:** [February 23, 2017, 9:08pm UTC](https://forum.pinegrow.com/t/functions-php-define-template-parts/720/4 "2017-02-23T21:08:52Z")

</div>

@pierrehansen yes that will add the necessary code to the functions.php file for your custom post type.
