Support

Home Forums Event Espresso Premium Category filtering in EE4

Category filtering in EE4

Posted: September 15, 2015 at 11:13 pm

Viewing 4 reply threads


Joe Z

September 15, 2015 at 11:13 pm

I’m wondering if I’m missing a way to give users the ability to view events by category–without having to create separate pages in my backend using shortcodes for each one.

In a normal category taxonomy, I could create a sidebar widget that would automatically show all the categories available, which would link to URLs for those categories.

My clients want to be able to create categories on the fly–so users can pick from a wide and changing range of event types–without calling me in to manually handle a major navigation update every time.

Even if I could code up a widget to enumerate the Event Espresso Categories, it seems that there is no URL structure I can use–only shortcodes.

Is there anything on the horizon that might help with this? Thanks!


Garth

  • Support Staff

September 15, 2015 at 11:22 pm

Hi Joe Z,

How are you today?

Depending on your permalink settings, try: event-category/category-slug/ e.g. domain.com/event-category/test/

That will give you the archive page results for the “Test” event category.

Does that help?


Joe Z

September 15, 2015 at 11:34 pm

That’s a big help! I didn’t try /event-category because I assumed that the Event Slug setting (which we have set to “/classes”) also controlled the categories permalinks. I guess Event Slug only controls the permalink to the full events list?

…Not trying to push it, but, do you think there is any way to change that -category permalink as well? Thanks!


Tony

  • Support Staff

September 16, 2015 at 4:25 am

Hi Joe Z,

Yes you can change the category slug, you can do that using the function from this post.

So something like this:

add_filter( 'FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', 'my_custom_event_category_slug');
	function my_custom_event_category_slug( $thearray ) {

		if ( !empty($thearray['espresso_event_categories']) ) {
			$thearray['espresso_event_categories']['args']['rewrite']['slug'] = 'my-event-cat';
			return $thearray;
		}
		return $thearray;
	}

Would change the event-category slug to my-event-cat.

You’ll need to flush your permalinks any time you change the slug for it to work.


Joe Z

September 22, 2015 at 4:15 pm

This worked perfectly, thanks so much!

Viewing 4 reply threads

The support post ‘Category filtering in 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