Linking my custom queries to the events page

Home Forums Calendar Products Events Calendar PRO Linking my custom queries to the events page

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

    Hi,

    I have a custom query pulling in 4 events on my home page. Im trying to get those to link to the corresponding Events page that is created for them. I have tried both of the below but none work. You can also see my custom code im using below.

    <?php the_permalink(); ?>
    <?php echo tribe_get_event_link() ?>


    <?php $events = tribe_get_events( array('posts_per_page' => 4) );
    foreach ( $events as $event ) { ?>
    <tr>
    <td>">

    <?php echo $event->post_title; ?>

    </td>
    <td>">

    <?php echo tribe_get_start_date( $event->ID ) ?>

    </td>
    <td>">

    <?php echo tribe_get_city( $event->ID ); ?>

    </td>
    </tr>
    <?php wp_reset_postdata(); } ?>

    #1230732
    Brook
    Participant

    Howdy Kari,

    I would love to help you find a solution for this as best I’m able.

    It looks to me like you might be missing the event ID. Instead of:

    <?php echo tribe_get_event_link() ?>

    What about:

    <?php echo tribe_get_event_link( $event->ID ) ?>

    Does that work better?

    Cheers!

    – Brook

    #1230861
    Kari Acker
    Participant

    This is exactly what I was looking for.

    Thank You.

    #1231510
    Brook
    Participant

    Excellent! You’re very welcome. Let us know if you ever need anything else.

    – Brook

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Linking my custom queries to the events page’ is closed to new replies.