Pulling in custom queries to my custom homepage – Round 2

Home Forums Calendar Products Events Calendar PRO Pulling in custom queries to my custom homepage – Round 2

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1207801
    Kari Acker
    Participant

    Hi, I had another thred open that is now closed but I need some help back on it.

    https://theeventscalendar.com/support/forums/topic/pulling-in-custom-queries-to-my-custom-homepage/#post-1185758

    I got the title working but the date and the city is still not showing up for me, below you can see my code.

    
    			<table class="stack events-table">
    				<tbody>
    					<?php $events = tribe_get_events( array('posts_per_page' => 5,) );
    					foreach ( $events as $event ) { ?>
    							<tr>
    								<td><a href="<?php the_permalink() ?>"><h4><?php echo $event->post_title ?><h4></a></td>
    								<td><p><?php echo tribe_get_start_date(); ?></p></td>
    								<td><p><?php echo tribe_get_city(); ?></p></td>
    							</tr>
    					<?php wp_reset_postdata(); } ?>
    				</tbody>
    			</table>
    

    Thanks for the help

    #1208394
    Brook
    Participant

    Howdy Kari,

    Good question. Both of those functions, tribe_get_start_date() and tribe_get_city() accept and event ID as a parameter. In this case you will need to tell them which event to show the date and city for, and you can do that by passing them an event ID. So replace this:

    tribe_get_start_date()

    With this:

    tribe_get_start_date( $event->ID )

    Does that make sense?

    Cheers!

    – Brook

    #1216583
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Pulling in custom queries to my custom homepage – Round 2’ is closed to new replies.