Reply To: Mushup php current category

Home Forums MapPress Support Mushup php current category Reply To: Mushup php current category

#12360
Chris
Keymaster

Hi,

It’s possible but you’ll need some PHP to do this.  You’ll need to get the category first (you can search wordpress.org for solutions to that).  Then run the mashup shortcode.

I haven’t tested it but for example: this should read the category id from the query variable ‘cat’:

$category_id = get_query_var('cat');
$shortcode = '[mashup query="cat=' . $category_id . '&posts_per_page=-1"]';
echo "Map of shortcode $shortcode" . "<br/>";
do_shortcode($shortcode);