Support » Plugin: All-in-One Event Calendar » [Plugin: All-in-One Event Calendar] Custom Query to homepage

  • Resolved michaelalbee

    (@michaelalbee)


    So I’ve been messing with this for hours and hours and hours …

    I have a custom homepage where I want to pull the next upcoming event in an event category. I’ll admit I know this is a hack job but I’ve tried everything … HELP!

    ‘<?php
    global $ai1ec_calendar_helper, $ai1ec_events_helper;
    $bits = $ai1ec_events_helper->gmgetdate( $ai1ec_events_helper->gmt_to_local( time() ) );
    $start_time = $ai1ec_events_helper->local_to_gmt( $now );
    $end_time = $ai1ec_events_helper->local_to_gmt( $end_time );
    $now = $ai1ec_events_helper->local_to_gmt( time(‘D, M d Y H:i:s’) );

    // The New Events Query
    $args = array(
    ‘posts_per_page’ => 1,
    ‘paged’ => get_query_var(‘paged’),
    ‘post_type’ => ‘ai1ec_event’,
    ‘cat_ID’ => ’40’,
    ‘orderby’ => ‘date’,
    ‘order’ => ‘ASC’,
    ‘post_status’ => ‘publish’,

    );

    $events_added = new WP_Query( $args );
    // The Loop
    while ( $events_added->have_posts() ) : $events_added->the_post();

    $event = Ai1ec_Calendar_Helper::get_events_between($now, $end_time, $filter, $spanning = false);

    ?>

  • ” href=”<?php the_permalink() ?>” rel=”bookmark”><?php the_post_thumbnail(‘home-features’); ?>
    <?php the_excerpt(); ?>
    <h2>

    ” href=”<?php the_permalink() ?>” rel=”bookmark”><?php the_title(); ?> </h2>

  • <?php

    endwhile;

    // Reset Post Data
    wp_reset_postdata();
    ?>

    http://wordpress.org/extend/plugins/all-in-one-event-calendar/

Viewing 6 replies - 1 through 6 (of 6 total)