Manual Query of Events

Home Forums Calendar Products Events Calendar PRO Manual Query of Events

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13244
    Chris
    Member

    I use custom queries to get events. Where is the example code for what works with 2.0.3 for these queries?

    Example:

    ‘sp_events’
    );
    $output = ‘objects’; // names or objects
    $post_types=get_post_types($args,$output);
    if ($post_types) {
    foreach ($post_types as $post_type ) {
    $type = $post_type->name;
    $args=array(
    ‘post_type’ => $type,
    ‘tax_query’ => array(
    array(
    ‘taxonomy’ => ‘sp_events_cat’,
    ‘field’ => ‘slug’,
    ‘terms’ => ‘rock-schedule’,
    ‘operator’ => ‘NOT IN’
    ),
    array(
    ‘taxonomy’ => ‘sp_events_cat’,
    ‘field’ => ‘slug’,
    ‘terms’ => ‘closed’,
    ‘operator’ => ‘NOT IN’
    )
    ),
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘_EventEndDate’, //2011-08-21 04:00:59
    ‘value’ => date(‘Y-m-d H:i:s’),
    ‘compare’ => ‘>=’
    )
    ),
    ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘_EventEndDate’,
    ‘order’ => ‘ASC’,
    ‘post_status’ => ‘publish’,
    ‘posts_per_page’ => 7,
    ‘caller_get_posts’=> 1
    );
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
    while ($my_query->have_posts()) : $my_query->the_post(); ?>

    #13246
    Chris
    Member

    False alarm! For those using queries, the taxonomy has changed from “sp_events” to “tribe_events” Update accordingly. So far so good.

    #13247
    Jonah
    Participant

    Sounds good Chris, let us know if you need any other help with this.

    #975068
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Manual Query of Events’ is closed to new replies.