Support

Home Forums Event Espresso Premium can ESPRESSO_EVENTS exclude a category with? (EE4)

can ESPRESSO_EVENTS exclude a category with? (EE4)

Posted: January 6, 2015 at 7:30 am


peter mumford

January 6, 2015 at 7:30 am

I am using the shortcode ESPRESSO_EVENTS. I see that I can list events from a category with this syntax from the categories page: [ESPRESSO_EVENTS category_slug=”private-events-1412787588″]

I would like to exclude one category. Is that possible?


peter mumford

January 6, 2015 at 7:32 am

clarification: I want to list all categories except private-events.


Dean

January 6, 2015 at 7:41 am

Hi,

No it can’t.

If you are OK with PHP, you may be better off doing an actual query to exclude that category. Here is an example query

https://gist.github.com/joshfeck/e3c9540cd4ccc734e755

It uses standard WP_Query parameters, plus some EE specific ones (http://codex.wordpress.org/Class_Reference/WP_Query).


peter mumford

January 6, 2015 at 10:13 am

Dean, thanks for the reply. Yes, I am familiar with PHP. Unfortunately the above code does not help, because it does NOT accept standard WP_Query parameters. It only accepts EE_Event_List_Query parameters. I tried to filter out the EE categories, using both a regular wp_query, and a EE_Event_List_Query. It doesn’t appear to work either way.

If the EE Category could be added to the CSS classes on the article element that would help a lot. Possible?


Lorenzo Orlando Caum

  • Support Staff

January 6, 2015 at 11:13 am

Hi, are you referring to something like this?

https://eventespresso.com/wiki/useful-php-code-snippets/#category-css


Lorenzo


peter mumford

January 6, 2015 at 1:05 pm

Hi Lorenzo, nice find! With that thing I can hide certain categories.

Actually, I think you guys should add more parameters to the shortcode, but this is a good workaround.


evan fort

January 14, 2015 at 10:15 am

I’m using wp_query. Is it possible to exclude a specific category here.

The support post ‘can ESPRESSO_EVENTS exclude a category with? (EE4)’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso