try this snippet – http://pastebin.com/MhkCLJkE
replace location with category
Thanks a lot agelonwl, this works like a charm. Hope this could be implemented in next releases for doing it from Events Manager Options (Format).
Do You have any idea about istead of a list, showing the events thumb in grid with its title upside?
Thanks again for your time!
Hi again agelonwl
After trying a few thing, with this placeholder in Single Event page
<h3>Other events in #_CATEGORYLINK</h3>
#_CATEGORYNEXTEVENTS
And with the code You gave me (changing location for category) something is happening: when there is not any future event in the current event category, the code gets just the future events in any category instead of showing the no events message…. Any idea?
This is the code I put in functions.php http://pastebin.com/m0dg79DV
in your snippet, try to change
$events = EM_Events::get( array('category'=>$EM_category->category_id, 'scope'=>'future', 'limit'=>7) );
to
$events = EM_Events::get( array('category'=>$EM_category->term_id, 'scope'=>'future', 'limit'=>7) );
I have made the change and the same result, You can see it here.
Thanks for your time!
UPDATE
I try this http://pastebin.com/k3dhn5N7 and now is working….buuut the code just takes the first category and if the event belongs to one or more just shows the events related with the first.
Another thing is: Is it possible doesn’t show the current event and just the other events in that category(ies)?
Thanks again for your time!
What I meant is than if “Event X” belongs to “category A” and “Category B” at the same time, the related events showed for that event are just this in “Category A” instead of showing related events for “Category A” and “Category B” even when there are other events for “Category B”
You can see it here and here
Regards.
I think your problem is that you’re searching for one term id, you probably want to create different lists for each category,
i.e. loop $EM_Event->get_categories()->categories
and then for each $EM_Category do something liks $EM_Category->output('#_CATEGORYNEXTEVENTS')
OR search multiple categories, for example
echo EM_Events::output(array('category'=>'1,2,3'));