• Resolved vinayakboga8

    (@vinayakboga8)


    Hello,

    I am using the Events Calendar Plugin and Its great!

    I am stuck with problem here.

    I have created a page where i want to list Upcoming events only.
    The Below code only displays the DateTime and Title of events. But
    i also want to display Event Location too.

    Also, I want to List events of particular event category only.

    For Example : Want to list Upcoming Events of Category name “American
    Events”.

    So i am using the below PHP code :

    <div class=”event-wrap”
    <div class=”upcoming-events”
    <ul class=”events”
    <?php
    global $post;
    $all_events = tribe_get_events(array(
    ‘eventDisplay’ = ‘past’,
    ‘category’ =’Events India’,
    ‘posts_per_page’ = 100
    ));
    foreach($all_events as $post) {
    setup_postdata($post);
    ?
    <li
    <span class=”date”<?php echo tribe_get_start_date($post-ID,
    false, ‘dS M, Y h:i a’); ?</span
    <a href=”<?php the_permalink(); ?”<?php the_title(); ?</a
    </li
    <?php } //endforeach ?
    <?php wp_reset_query(); ?
    </ul
    </div
    <!– end .upcoming-events —
    <!–p<a class=”green cta-button” href=”<?php echo get_bloginfo(‘url’);
    ?/events/”More Events</a</p–
    </div
    <!– end .event-wrap —

The topic ‘Get Events by Category.’ is closed to new replies.