Viewing 1 replies (of 1 total)
  • mttindustries

    (@mttindustries-1)

    you could try using the event short code on the wordpress page. Which is in the documentation somewhere. Or add it via php in hard code to your page template, something along the lines of this is what I used:

    <?php 
    
    //Define your custom post type name in the arguments
    
    $args = array(
    'post_type' => 'event',
    'showposts' => '12',
    'meta_query' => array(
    	array(
    	'key' => 'event-end-date',
    	'value' => $today,
    	'compare' => '>='
    	)
    ),
    'post_status' => 'publish',
    'orderby' => 'date',
    'order' => 'ASC',
    
    );
    
    //Define the loop based on arguments
    
    $loop = new WP_Query( $args );
    
    //Display the contents
     ?>
     <?php if ( $loop->have_posts() ) : ?>
    <table class="shows">
    <?php while ( $loop->have_posts() ) : ?> <?php $loop->the_post();
    $event_start_date = get_post_meta( get_the_ID(), 'event-start-date', true );
    				$event_end_date = get_post_meta( get_the_ID(), 'event-end-date', true );
    ?>
      <tr>
    	<td class="date"><?php echo date_i18n( 'M', $event_start_date ); ?><br />
           <?php echo date_i18n('d', $event_start_date ); ?>-<?php echo date_i18n('d', $event_end_date ); ?><br />
            <span><?php echo date_i18n('Y', $event_start_date ); ?></span></td>
         <td class="info"><?php the_content(); ?>
        </td>
      </tr>
    <?php endwhile;?>
    </table>
    <?php else: ?>
    <p>Sorry there are no shows scheduled at the moment. Please check back again soon.</p>
    <?php endif; ?>
    <?php wp_reset_query(); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘place all events on a page’ is closed to new replies.