Title: Registering multiple custom post types
Last modified: August 20, 2016

---

# Registering multiple custom post types

 *  Resolved [yolise](https://wordpress.org/support/users/yolise/)
 * (@yolise)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/registering-multiple-custom-post-types/)
 * I searched but it seems that others having this issue figure it out for themselves
   before anyone has a chance to reply and the solution never gets posted.
 * Everytime I try to register a second post type, it breaks my function file. I
   assume this is because your can’t just duplicate the add_action init or the function
   name, but not being all that when it comes to php, I’m not sure which can and
   can’t be reused.
 * Can someone explain how to register more than one custom post type?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Nikki Blight](https://wordpress.org/support/users/kionae/)
 * (@kionae)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/registering-multiple-custom-post-types/#post-2548195)
 * I do it like this:
 *     ```
       function my_create_post_types() {
       	register_post_type( 'my_post_type', $args);
       	register_post_type( 'my_other_post_type', $args);
       }
       add_action( 'init', 'my_create_post_types' );
       ```
   
 *  Thread Starter [yolise](https://wordpress.org/support/users/yolise/)
 * (@yolise)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/registering-multiple-custom-post-types/#post-2548198)
 * Ah, that’s the ticket! Thanks – I’m sure this will all make sense to me one day.
 * I notice that your add_action init comes after the function. Mine’s before and
   it still seems to work. Does it matter?
 *  [Nikki Blight](https://wordpress.org/support/users/kionae/)
 * (@kionae)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/registering-multiple-custom-post-types/#post-2548283)
 * The order doesn’t matter. I just do it that way because it make more sense to
   my brain. 😉

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Registering multiple custom post types’ is closed to new replies.

## Tags

 * [add_action](https://wordpress.org/support/topic-tag/add_action/)
 * [custom_post_type](https://wordpress.org/support/topic-tag/custom_post_type/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Nikki Blight](https://wordpress.org/support/users/kionae/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/registering-multiple-custom-post-types/#post-2548283)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
