Home › Forums › Calendar Products › Events Calendar PRO › Past Course Feed
- This topic has 3 replies, 2 voices, and was last updated 8 years ago by Josh.
-
AuthorPosts
-
May 16, 2016 at 7:30 am #1114896ChrisParticipant
Im using the following to output a feed of previous (past) courses in specific categories (i.e. mexico) but it only outputs the most recent past events regardless of category:
// Ensure the global $post variable is in scope
global $post;
// Retrieve 2 Past Events
$events = tribe_get_events( array(
'taxonomy' => TribeEvents::TAXONOMY,
'eventDisplay' => 'past',
'posts_per_page' => 2,
'order' => 'DESC',
'terms' =>array('Mexico'),
'operator'=>'IN') );
May 16, 2016 at 5:48 pm #1115190JoshParticipantHey Chris,
Thanks for reaching out to us!
Try modifying that query to utilize a tax_query and see if that helps to address the issue here.
Let me know if this helps.
Thanks!
May 17, 2016 at 1:48 am #1115258ChrisParticipantSORTED!
Thanks for your guidance:
<?php // Ensure the global $post variable is in scope global $post; // Retrieve 2 Past Events $args = array ( 'post_type' => 'tribe_events', 'eventDisplay' => 'past', 'posts_per_page' => 2, 'order' => 'DESC', 'tax_query' => array( array( 'taxonomy' => TribeEvents::TAXONOMY, 'field' => 'slug', 'terms' => array('london-butler-school-courses'), 'operator'=>'IN' , ), ), ); $events = tribe_get_events( $args ); // Loop through the events: set up each one foreach ( $events as $post ) { setup_postdata( $post ); ?>
- This reply was modified 8 years ago by Chris.
May 18, 2016 at 7:52 am #1115872JoshParticipantHey Chris,
Awesome! I’m glad we were able to help get this one sorted for you!
I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.
Thanks!
-
AuthorPosts
- The topic ‘Past Course Feed’ is closed to new replies.