Title: Create a custom loop for events
Last modified: September 1, 2016

---

# Create a custom loop for events

 *  Resolved [raybeam](https://wordpress.org/support/users/raybeam/)
 * (@raybeam)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/create-a-custom-loop-for-events/)
 * Hi, thanks for your plugin. Before I really want to use your plugin, I would 
   like to know if it’s possible to create a custom loop for the events? I’m guessing
   it is but would like to check. I have a very distinct design to follow and therefore
   can’t just plugin a shortcode with preconfigured html etc. Would prefer it if
   I can write a loop for the post type that includes the useful data. For the most
   part I just want to show 3 events on the home page with title and link and one
   upcoming event. For the main events page I’d be ok to go with the out of the 
   box look and work from that.
 * In short, all I need to know is (probably can find this from digging through 
   the code), what is the post type name? Again, I think I have answered my own 
   question here but of you can confirm or give me a tip that would be great.
 * Thanks
 * [https://wordpress.org/plugins/the-events-calendar/](https://wordpress.org/plugins/the-events-calendar/)

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

 *  [Caroline](https://wordpress.org/support/users/tribecari/)
 * (@tribecari)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/create-a-custom-loop-for-events/#post-7484348)
 * Hi [@raybeam](https://wordpress.org/support/users/raybeam/),
 * Thanks for getting in touch! The conditional `is_singular('tribe_events')` may
   work for what you’re describing–give it a try and let us know if you should run
   into any issues as you go!
 * Thank you!
 *  Thread Starter [raybeam](https://wordpress.org/support/users/raybeam/)
 * (@raybeam)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/create-a-custom-loop-for-events/#post-7484353)
 * Thanks, but that wasn’t quite what I was looking for. What I did in the end in
   case anyone else is trying to do this is:
 *     ```
       <?php $args = array(
       			'post_type' => 'tribe_events',
       			'posts_per_page' => 3
       		); 
   
       $query = new WP_Query($args);
       if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); ?>
        // do custom template stuff here
       <?php endwhile; endif; wp_reset_postdata(); ?>
       ```
   
 * So my problem is partially solved but I have a unique scenario where I want to
   show recent events, not just upcoming events. How can I do that?
 *  [Geoff Graham](https://wordpress.org/support/users/geoffgraham/)
 * (@geoffgraham)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/create-a-custom-loop-for-events/#post-7484416)
 * Hey [@raybeam](https://wordpress.org/support/users/raybeam/),
 * Does the article I linked to in your other thread help with this as well?
 * [https://wordpress.org/support/topic/how-can-i-display-past-events-in-a-custom-loop?replies=2](https://wordpress.org/support/topic/how-can-i-display-past-events-in-a-custom-loop?replies=2)
 * Following the examples of how to use `tribe_get_events()` will allow you to show
   both past and upcoming events together.
 * Thanks!
    Geoff

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

The topic ‘Create a custom loop for events’ 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/)

## Tags

 * [custom loop](https://wordpress.org/support/topic-tag/custom-loop/)
 * [events](https://wordpress.org/support/topic-tag/events/)

 * 3 replies
 * 3 participants
 * Last reply from: [Geoff Graham](https://wordpress.org/support/users/geoffgraham/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/create-a-custom-loop-for-events/#post-7484416)
 * Status: resolved