WordPress.org

Ready to get started?Download WordPress

Forums

All-in-One Event Calendar
[resolved] Custom Event Post Type Feed (5 posts)

  1. digitalrenewal
    Member
    Posted 2 years ago #

    Id like to feed the latest events on my home page. I have it working, but having trouble finding the Start Date function from this plugin... Heres what I have. It works pretty well, but the time and location doesnt display. any ideas?

    <ul class="calendar">
    <?php query_posts( array( 'post_type' => 'ai1ec_event', 'posts_per_page' => 7 ) );
    while (have_posts()) : the_post();
    ?>

  2. <?php echo $event->timespan_html ?> - <?php the_title(); ?> <?php echo $location ?>
    <p class="link">">View Event → </p>
  3. <?php endwhile; ?>

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

  • Richard
    Member
    Posted 2 years ago #

    Hi digitalrenewal,

    Probably the easiest thing would be to insert the agenda shortcode into a post on your homepage. All shortcodes are listed here: http://help.then.ly/customer/portal/articles/530440-what-shortcodes-are-available-

  • Richard
    Member
    Posted 2 years ago #

    Hi digitalrenewal,

    Probably the easiest thing would be to insert the agenda shortcode into a post on your homepage. All shortcodes are listed here: http://help.then.ly/customer/portal/articles/530440-what-shortcodes-are-available-

  • digitalrenewal
    Member
    Posted 2 years ago #

    I actually got this working. The shortcodes are GREAT! but this is actually what I was going for...

    <ul class="calendar">
            <?php   // Calender Events Query http://wordpress.org/support/topic/plugin-all-in-one-event-calendar-custom-events-list-display?replies=6
    		  $args = array(
    			  'posts_per_page'  => 7,
    			  'paged'		  => get_query_var('paged'),
    			  'post_type'       => 'ai1ec_event',
    			  '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_Events_Helper::get_event($post->ID);
    		  ?>
                <li>
    			  <?php echo $event->short_start_date;?> - <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a>
                  <p class="detail">
                  <span class="time"><?php echo $event->start_time; ?> @ <?php echo $event->location;?></span>
                  <span class="link"><a href="<?php the_permalink() ?>">View Event &rarr; </a></span>
                  </p>
                </li>
    		  <?php endwhile; wp_reset_postdata(); ?>
            </ul>
  • jlwest595
    Member
    Posted 2 years ago #

    Hi! This is EXACTLY what I was looking to do too! Can you tell me how to implement this? I want to feed just the most recent 2 or 3 events in agenda view onto my homepage. Where should I add this code and what shortcode should I use to make it show up? THANK YOU in advance

  • Topic Closed

    This topic has been closed to new replies.

    About this Plugin

    About this Topic

    Tags

    No tags yet.