WordPress.org

Ready to get started?Download WordPress

Forums

All-in-One Event Calendar
[resolved] Event custom loop (3 posts)

  1. carletto0282
    Member
    Posted 2 years ago #

    Hi there,
    I'd like to thank you for your great work.

    I'm making a sort of portal and I need several loops in the homepage.

    I'd like to have also a loop with my events.

    I'm trying to use a wp_query like this

    // The Last Added Event Query
    				$args = array(
    							'posts_per_page'  => 3,
    							'post_type'       => 'ai1ec_event',
    							'orderby'         => 'date',
    							'order'           => 'DESC',
    							'post_status'     => 'publish' );
    
    				$last_added_events = new WP_Query( $args );
    
    				if ( have_posts() ) :
    				echo '<ul>';
    			// The Loop
    				while ( $last_added_events->have_posts() ) : $last_added_events->the_post();
    				?>
    					<li>
    						<a href="<?php echo the_permalink(); ?>" title="<?php echo the_title_attribute(); ?>">
    							<?php echo the_title(); ?>
    						</a>
    					</li>					
    
    				<?php
    				endwhile;
    				echo '</ul>';
    				else:
    				?>
    					<ul>
    						<li><p>Sorry, no events at the moment.</p><li>
    					</ul>
    				<?php
    				endif;
    
    			// Reset Post Data
    				wp_reset_postdata();

    My problem is that I'd like to show also the date and the map of that event but I don't know how to do.

    Thanks

    Carloalberto

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

  2. josjo
    Member
    Posted 2 years ago #

  3. carletto0282
    Member
    Posted 2 years ago #

    Thanks josjo.
    Great!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic