thanks for your reply, but i need to get it from custom query for custom formatting needs.
I do not exclude that it would be possible to do it with the shortcode, I can give it a try, in the meantime you could post an example ?
this is my approach, but it doesn’t work, return empty list
<ul>
<?php
new WP_Query( array( 'post_type' => 'event', 'showposts' => 1,
'meta_query' => array(
array(
'key' => '_location_id',
'value' => '56'
)
)
));
$related_evts = new WP_Query( array(
'post_type' => 'event',
'orderby'=>'event_start_date',
'location'=>56 // todo: non funzia il by location.
) );
while ($related_evts->have_posts()) : $related_evts->the_post(); $ID = get_the_ID();
$evts = EM_Events::get( array(
'scope'=>'future',
'post_id' => $ID,
'limit'=>3,
'format'=>'#_{D d M Y} #_NAME #_NOTES etc',
'orderby'=>'#_12HSTARTTIME'
)
);
foreach ($evts as $evt) : ?>
<a href="<?=get_the_permalink(); ?>">
<li>
<div class="image"><?php echo get_the_post_thumbnail($id, 'home-box'); ?></div>
<h4><? $categories = $evt->get_categories()->categories;
foreach ($categories as $category) :
echo "·".$category->name." ";
endforeach; ?>
</h4>
<h3><?=$id_location?><?php the_title(); ?></h3>
<h4><?php em_events( array( 'post_id' => $ID, 'format' => '#j #F #Y #@_{j F Y}') ); ?></h4>
</li>
</a>
<?php endforeach; ?>
<?php endwhile;
?>
</ul>