Support » Plugin: Events Manager » Category filter doesnt work after excluding category from eventlist

  • Resolved Fesch

    (@fesch)


    Hi,

    I’m trying to exclude a category from the main eventlist by adding this to the events-list.php

    $args[‘category’] = “-34”;

    It works fine. But I still want the category to be found by using the
    “em-events-search-category” filter.

    In other words:
    If “All Categories” is selected, I want to exclude category 34. But if category 34 is selected from the dropdown, I still want to show all events from category 34.

    Is this possible?

    After adding $args[‘category’] = “-34”; to the template, the “em-events-search-category” filter isn’t working anymore. No matter which category I choose from the dropdown, all categories are shown in the list.

    Is there something I’m doing wrong?

    Thank you!

    https://wordpress.org/plugins/events-manager/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    hmm, you mean when you search an event with a particular category still all category will show?

    Yes, here is the link to the site.
    http://fachschaft.disziplin-gestaltung.de/

    If you try to filter the events using the filter-bar below the slider, it doesn’t work.

    The category I want to exclude from the list is “Jobs”.

    Thank you.

    Plugin Support caimin_nwl

    (@caimin_nwl)

    The filter is the black and white bar? Because it doesn’t seem to be doing anything at all. No matter which I click the contents underneath remains the same.

    Yes it is the black bar.

    No matter which I click the contents underneath remains the same.

    Thats the problem.

    It stoped working after I added $args[‘category’] = “-34”; to my template file, in order to remove post from the category 34 from the mainlist.

    When I remove $args[‘category’] = “-34”; from the template it works.

    Check the site again, I removed the tag. Now the filter works again.

    Plugin Support caimin_nwl

    (@caimin_nwl)

    Where exactly are you adding the

    $args['category'] = "-34"

    bit? It sounds like you might be adding it to the event list template, rather than the search template.

    Yes, I added it to the eventlist.php. As I don’t want events from category 34 to show up in the main list, only if you select category 34 in the filter.

    Is this wrong?

    Thank you

    Plugin Support angelo_nwl

    (@angelo_nwl)

    just to confirm, the filter is the bar with Fotos, Jobs, Release, etc… ? and you want to remove Jobs from there?

    just to confirm, the filter is the bar with Fotos, Jobs, Release, etc… ?

    Yes, this is the filter

    and you want to remove Jobs from there?

    No, I dont want to remove Jobs from the filter. I just dont want events from the Job category to be visible, if all events are visible. Only if you select Jobs in the filter.

    Thanks!

    I fixed it by adding

    if(empty($args[‘category’])){$args[‘category’] = “-34”;};

    to my event-list template.

    Now events from category 34 are only visible, if selected in the filter.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Category filter doesnt work after excluding category from eventlist’ is closed to new replies.