• Resolved Fi Fi P

    (@fi-fi-p)


    I added a support thread before but messed up the code section so I will try again below.
    I have added a slider to my site and it displays all future events.
    All works lovely but only the latest Events displays the Date of the event, the rest only show the title and now date?!
    I’ll add my code below but any help would be greatly appreciated:

    <div id="top-flexslider-event">
    <div class="flexslider-event">
    <div id="carousel">
    <?php
    // args
    
    $args = array(
    'numberposts' => -1,
    'post_type' => 'event',
    'meta_query' => array(
    array(
    'key' => '_start_ts',
    'value' => current_time('timestamp'),
    'compare' => '>=',
    'type'=>'numeric'
    )
    )
    );
    
    // get results
    $the_query = new WP_Query( $args );
    
    // The Loop
    ?>
    <?php if( $the_query->have_posts() ):
    
    global $post;
    $EM_Event = em_get_event($post->ID, 'post_id');?>
    
    <?php setup_postdata(); ?>
    <ul class="slides">
    
    <?php while ( $the_query->have_posts($post->ID) ) : $the_query->the_post($post->ID); ?>
    
    <div class="slide-content">
    <div class="slide-title">
    "><?php the_title(); ?></br>
    <?php the_date(); ?>
    
    </div>
    
    <?php the_post_thumbnail('e-slide', array()); ?>
    </div>
    
    <?php endwhile; ?>
    
    <?php wp_reset_postdata();?>
    <?php endif; ?>
    
    <?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
    
    </div><!-- #carousel -->
    
    </div><!-- .flexslider-event -->
    </div><!-- #top-flexslider-event -->

    This is a link to the site
    http://www.sgtesting.co.uk/blackwood/

    https://wordpress.org/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display Events in a slider’ is closed to new replies.