Events Manager Plugin – Hack to display events by categories

I have a client who uses the Events Manager plugin by Davide Benini and Marcus Skyes to manage events on their site. Unfortunately, the plug-in doesn't let you display events by category (which is weird, otherwise, why have the categories?) but anyway, I wrote/hacked together a custom function and WordPress shortcode today to display the events by category. Now, I know there are going to be the naysayers who say "This code isn't very pretty".  Yeah, well maybe not but it works.  And if you can improve on it, DO!  I'm totally open to it.  For instance, the edit I did makes more than one query to the DB which isn't optimal. Okay, so without further ado, here it is. Open up the file in your events-manager/ folder called 'marcus-extras.php'.  Around line 264 you'll find a function called dbem_get_category().  I added my custom function and shortcode right below it : 1 And then: 1 The shortcode is - [dbem_events_by_category] and you can just insert it into your post or page whereever you want it to go. By default it outputs ALL events under ALL categories but you could hack it up pretty easily to only display one category, etc. I may do that later if enough people ask for it but it's not what I needed so, didn't get done. :) Hope this helps some folks. Let me know if you have any questions!

    • Marty has been an active search marketing professional for over 12 years. He has consulted with the Fortune 100 and Fortune 500 as well as medium to small B2B and B2c businesses, governments and higher ed.