# How to register a custom post type using Pinegrow in a plugin

**URL:** https://forum.pinegrow.com/t/how-to-register-a-custom-post-type-using-pinegrow-in-a-plugin/6174
**Category:** WordPress
**Tags:** plugin
**Created:** [January 22, 2022, 4:04pm UTC](https://forum.pinegrow.com/t/how-to-register-a-custom-post-type-using-pinegrow-in-a-plugin/6174 "2022-01-22T16:04:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Roel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/roel/32/1753_2.png) [@Roel](https://forum.pinegrow.com/u/Roel)
#### Post date: [January 22, 2022, 4:04pm UTC](https://forum.pinegrow.com/t/how-to-register-a-custom-post-type-using-pinegrow-in-a-plugin/6174/1 "2022-01-22T16:04:34Z")

</div>

Hey there,

I was wondering how one registers a custom post type using the new Wordpress plugin feature (exporting the project as a plugin rather than a theme) as I tried doing it the way I would do it in a theme (by just including the post loop action and using the option to register a post type) but that doesn’t seem to work. Is there something I’m missing?

---

<div class="post-metadata">

### Author: ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)
#### Post date: [January 22, 2022, 5:00pm UTC](https://forum.pinegrow.com/t/how-to-register-a-custom-post-type-using-pinegrow-in-a-plugin/6174/2 "2022-01-22T17:00:22Z")

</div>

Hi @Roel,  
I have to look into this a bit.  
Cheers,  
Bob

---

<div class="post-metadata">

### Author: ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)
#### Post date: [January 22, 2022, 5:55pm UTC](https://forum.pinegrow.com/t/how-to-register-a-custom-post-type-using-pinegrow-in-a-plugin/6174/3 "2022-01-22T17:55:23Z")

</div>

The plugin feature is currently particularly oriented towards the Gutenberg blocks feature. imho, you should define your theme custom post types from the index theme template.

> **[Theme or Plugin – Which is Best for Custom Blocks? | Pinegrow Web Editor](https://pinegrow.com/docs/wordpress/creating-custom-wordpress-blocks/theme-or-plugin-where-to-define-custom-blocks/)**
>
> Where to define our custom blocks? In a theme or plugin?

---

<div class="post-metadata">

### Author: ![Roel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/roel/32/1753_2.png) [@Roel](https://forum.pinegrow.com/u/Roel)
#### Post date: [January 22, 2022, 6:38pm UTC](https://forum.pinegrow.com/t/how-to-register-a-custom-post-type-using-pinegrow-in-a-plugin/6174/4 "2022-01-22T18:38:14Z")

</div>

Ok, thanks for the info.  
The reason why I asked is because I’m trying to recreate a laptop reservation app I once made in Microsoft PowerApps in WordPress. It seemed best to include it into the from of a plugin, rather than a theme. The use case requires a custom post type to be created where the data if each “laptop” is stored (and is user editable). But it that isn’t possible, I suppose I’ll switch it to a theme as it is only a hobby project after all.

---

<div class="post-metadata">

### Author: ![Roel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/roel/32/1753_2.png) [@Roel](https://forum.pinegrow.com/u/Roel)
#### Post date: [January 27, 2022, 3:29pm UTC](https://forum.pinegrow.com/t/how-to-register-a-custom-post-type-using-pinegrow-in-a-plugin/6174/5 "2022-01-27T15:29:50Z")

</div>

Update:

It appears to be working now (as part of the plugin), my bad…sorry
