Home › Forums › MapPress Support › Mashup shortcde not limiting no post per page › Reply To: Mashup shortcde not limiting no post per page
February 2, 2020 at 5:33 am
#18461
Hi,
I gave an example earlier using post date, but for a custom field the query would be:
[mashup query="post_type=Event&meta_key=Expires&meta_value=20200201"]
However, unlike queries by post_date, WP doesn’t provide any way to pass a dynamic date for the meta_value in the query string.
One solution is to add some PHP to one of your theme’s template files to generate the map instead:
<?php $date = date('Ymd'); $query = "post_type=Event&meta_key=Expires&meta_value=$date"; echo do_shortcode('[mashup query="' . $query . '"]'); ?> ?>