Hi,
I’m not much of a dev.
I want to achieve 3 Pages –
- Todays Events (The whole Post ) – This will be the home page
- Next 7 Days Events (The whole Post – including all content like archives)
- Maybe next 30 Days (Maybe full,maybe a list)
If i use the shortcode-event-list I can’t work out how to add all of the content. Is this possible?
Is there a way to show the default archives for say next 7 days? That’s pretty much what I want.
Should I copy the archive pages as a template and change that to only show next 7 days?
Any help appreciated.
Chris

chris britton
I’ve managed it.
$original_query = $wp_query;
$wp_query=null;
$args = array(
event_start_after=> 'today',
event_start_before=>'+1 week',
post_type=>'event',
posts_per_page => -1
);
$wp_query=new WP_Query($args);
?>
Attached to The Archive-event.php and saved as a template. Then saved 3 versions for 1,7 and 30. I’m sure there’s a more elegant way to do this. Especially as I’m using genesis, but i’ll work on that!

chris britton
Hi Chris,
Yup, that’s how to do it. I would use a different variable than $wp_query
, and don’t forget to call wp_reset_postdata()
afterwards:
For your home page you could add the following to your home page template.
$event_query = new WP_Query( ... )
if( $event_query->have_posts() ){
while( $event_query->have_posts() ):
$event_query->the_post();
//the_title(); the_content();// etc are all available
endwhile;
}
wp_reset_postdata();
For the two you could use the shortcode with the placeholders (see docs). Or you could create a a page template with the above code in it.
Is there a way to show the default archives for say next 7 days? That’s pretty much what I want.
You can add the following to your functions.php
add_action( 'pre_get_posts', 'my_set_event_archive' );
function my_set_event_archive( $query ){
if( $query->is_main_query() && eventorganiser_is_event_query( $query ) ){
if( eo_is_event_archive() && !eo_is_event_archive( 'day' ) && !eo_is_event_archive( 'month' ) && !eo_is_event_archive( 'year' ) ){
//Event archive, but not day/month/year archive
$query->set( 'event_start_after', 'now' );
$query->set( 'event_start_before', '+7 days' );
}
}
}

Stephen Harris