Hi there,
I’m trying to configure a standard wp_query and use the relative date parameters for wp event organiser. But it’s not working – am I using these incorrectly? I tried using your eo_get_events() function but I struggled to pull in other fields for the event post such as the excerpt.
Any help appreciated.
array( 'event' ),
'event_end_after'=>'now',
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => 10,
'paged' => $paged
) ); ?>
have_posts() ) : $loop->the_post(); ?>
<div class="post ">
<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<p class="teaser"><?php the_excerpt_rss(); ?> <a class="morelink" href="<?php the_permalink() ?>" title="<?php the_title(); ?>">[More]</a></p>
</div>
<?php endwhile; wp_reset_query(); ?>
Dan Branigan
Let me try that code paste again!
array( 'event' ),
'event_end_after'=>'now',
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => 10,
'paged' => $paged
) ); ?>
have_posts() ) : $loop->the_post(); ?>
<div class="post ">
<a href="" title="">
<a class="morelink" href="" title="">[More]
Dan Branigan
Hi Dan,
Looks like the forum swallowed your code… The forum uses markdown and the easiest way to display blocks of code is to leave a blank line and indent the lines of code by at least 4 spaces. Alternatively, write out the code, highlight it and use the {}
icon. Back tics can be used for inline-code.
As for your question, try
$event_query = new WP_Query( array(
'post_type' => 'event', //Pass as string rather than array
'suppress_filters' => false, //Just to be sure it isn't set to 'true'.
'event_end_after'=>'now',
'orderby' => 'eventstart', //There isn't a menu order for events
'order' => 'ASC',
'posts_per_page' => 10,
'paged' => $paged
) );
When using eo_get_events()
– as with get_posts()
– you can’t automatically use functions like the_content()
and the_exerpt()
as these need to be used in side ‘the loop’*. Also, when using other functions provided by Event Organiser outside of loop (e.g. eo_get_the_start()
), then you will need to pass the post ID and (where appropriate) the occurrence ID (see examples)
Hope that helps!
* (I wrote an article about using the_content()
outside of the loop.- by following that you can use eo_get_events()
as if you were ‘in the loop’ too)
Stephen Harris