• Resolved Fi Fi P

    (@fi-fi-p)


    I love this plugin! I use it a lot and I am using it more and more as I discover how many things it can be used for.
    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); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Glad you like the plugin ??

    Could you repost this question in a new thread but use the code button on your code so that it doesn’t get mangled? Thanks.

    Thread Starter Fi Fi P

    (@fi-fi-p)

    Sorry about that!

    `
    <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 –>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘display Events in a slider with Title and date’ is closed to new replies.