I have written a plugin for my site that holds membership directory data. There are many categories that a member can be listed in, and as such, I have shortcode that will allow me to display results from a category on any page. For instance, the code
[tmcategory cat="100" link="http://www.bellingham.org/membership/member-directory/"]
Outputs the data you see here:
http://www.bellingham.org/discover/services/
All my shortcode needs is the category number and the link is optional.
Now on some pages, I want to show more than one list of results. My events page, for example, I want to output the Meeting Spaces members, and then a list of the Catering members. The problem is that if I use a second instance of the shortcode above, it will show the first results a second time, followed by the new results. i.e. if I try to do [tmcategory cat="100"] and then [tmcategory cat="200"] my results page will show:
Category 100 results
Category 100 results
Category 200 results
I build the output results as a string that I return at the end so it seems simple enough - I need to clear the variable storing my output results after displaying them so that the second instance of the shortcode doesn't just append the new results to the old. But... I'm just not figuring out how to do that. I'm sure it's really easy and I am just being dense.
Help is appreciated. :)