Support » Plugin: Event Organiser » Display start date in WP basic search result

  • Hello,
    Our events are listed in the basic WP search result.
    We would like to add the start date after the title if it’s an event.

    In content-search.php: we used this:

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">
    		<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
    	</header><!-- .entry-header -->
    	<?php $date= eo_get_the_start( 'Ymd', $post_id ); echo $date; ?>
    	<div class="entry-summary">
    		<?php the_excerpt(); ?>
    	</div><!-- .entry-summary -->
    </article><!-- #post-<?php the_ID(); ?> -->

    without no success…

    If we try width the venues… we add:

    <?php echo 'Place:'.eo_get_venue_name(); ?>

    We get the Venue name in our search result.
    Everything ok

    BUT i don’t get the start date with all this test:

    <?php echo 'Date: '.eo_get_the_start(); ?>
    <?php echo 'Date: '.eo_get_the_start( 'jS F Y', $post->ID ); ?>
    <?php echo eo_get_the_start('jS M YY', $post->ID); ?>
    <?php echo eo_get_the_start("jS M YY"); ?>
    <?php echo eo_get_the_start(); ?>
    <?php echo eo_get_the_start( 'jS F Y', $post->ID, $post->occurrence_id ); ?>
    <?php eo_the_start( $format = 'd-m-Y', $post->ID );?>
    <?php eo_the_start( $post->ID );?>

    Somebody see what we are doing wrong…


  • The topic ‘Display start date in WP basic search result’ is closed to new replies.