[Plugin: Events Manager] random single event with contact avatar
-
ok – i’ve been hacking at this for WEEKS.
it’s ALMOST perfect, but i cannot get it to limit the events to FUTURE events…
seems i can either limit to future and NOT have the avatar… or have the correct avatar but not limit to future.here’s what i’ve got:
<div id="featuredevent"> <?php //if ( function_exists( 'get_smooth_slider' ) ) { //get_smooth_slider('1'); } //} // The Query $the_query = new WP_Query( 'post_type=event&orderby=rand&posts_per_page=1&scope=future' ); // The Loop while ( $the_query->have_posts() ) { $the_query->the_post(); echo '<h3>' . get_the_title() . '</h3>'; echo '<span class="fev-image">' . do_shortcode('[event scope="future"]#_CONTACTAVATAR[/event]') . '</span>'; echo '<p>' . the_excerpt() .'<p>'; } /* Restore original Post Data * NB: Because we are using new WP_Query we aren't stomping on the * original $wp_query and it does not need to be reset. */ wp_reset_postdata(); ?> </div>
i realized i’ve got both the query and the shortcode looking for scope=”future” – that doesn’t work… didn’t work without the shortcode arg either…
soooo close. would be really really grateful for help.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: Events Manager] random single event with contact avatar’ is closed to new replies.