Title: Custom post type not registering
Last modified: August 30, 2016

---

# Custom post type not registering

 *  Resolved [son0fhobs](https://wordpress.org/support/users/son0fhobs/)
 * (@son0fhobs)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/custom-post-type-not-registering/)
 * When I go to an event, it’s registering as a “page” post type, and the global
   object $post is empty. ( At the bottom of this entry I show some debug code and
   what it displays )
    Although the event displays fine, getting custom metadata
   and related info doesn’t work given it’s not registering as an event. Before 
   I updated the plugin from 3.9.x, it was registering as an “event” post type and
   the post object was filled.
 * Info:
    The Events Calendar PRO v 3.12.2 The Events Calendar v 3.12.3 WP version
   4.2
 * Here’s the page: [http://ethoschicago.staging.wpengine.com/event/sunday-service/2015-10-25/](http://ethoschicago.staging.wpengine.com/event/sunday-service/2015-10-25/)
   
   Add ?debug for debug info: [http://ethoschicago.staging.wpengine.com/event/sunday-service/2015-10-25/?debug](http://ethoschicago.staging.wpengine.com/event/sunday-service/2015-10-25/?debug)
 * Here’s the code that’s displaying that info:
 *     ```
       echo var_dump(get_post_type($post->ID)); // - page
       echo var_dump(tribe_is_event($post->ID)); // - false
       echo var_dump($post->ID); // - 0
       echo var_dump(get_post_type()); // page
       echo var_dump(get_post_type( $post->ID )); // page
       echo var_dump($post); // Post object, empty
       ```
   
 * Any ideas?
    Thanks a bunch! David
 * [https://wordpress.org/plugins/the-events-calendar/](https://wordpress.org/plugins/the-events-calendar/)

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

 *  [Brook](https://wordpress.org/support/users/brook-tribe/)
 * (@brook-tribe)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/custom-post-type-not-registering/#post-6668715)
 * Howdy David,
 * I am sorry the $post var is no longer looking working for the location of your
   code. Depending on where the code is there might be a different variable setup,
   which you could find by setting a breakpoint with a debugger such as x-debug.
   However there is also a possibility the query will not have run yet, or a new
   query will have override it. In this case it will be easiest for your to do a
   new query for the event details you need. You can get the post ID from the slug,
   and do your meta query from there.
 * [https://codex.wordpress.org/Class_Reference/WP_Query](https://codex.wordpress.org/Class_Reference/WP_Query)
 * I hope that info helps. Cheers!
    – Brook
 *  Thread Starter [son0fhobs](https://wordpress.org/support/users/son0fhobs/)
 * (@son0fhobs)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/custom-post-type-not-registering/#post-6668721)
 * That’s a brilliant solution! Thanks so much for your help!
 *  Plugin Contributor [Brian](https://wordpress.org/support/users/brianjessee/)
 * (@brianjessee)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/custom-post-type-not-registering/#post-6668747)
 * Glad Brook Could Help!

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

The topic ‘Custom post type not registering’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Brian](https://wordpress.org/support/users/brianjessee/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/custom-post-type-not-registering/#post-6668747)
 * Status: resolved