Support

Home Forums Event Espresso Premium sort order, slug

sort order, slug

Posted: May 30, 2024 at 5:37 am

Viewing 8 reply threads


Roberta Biese

May 30, 2024 at 5:37 am

Is there a way to have the events sort on the slug instead of the title??


Sam

  • Support Staff

May 30, 2024 at 5:56 am

Hi there,

Can you please give me some more details about what exactly you are trying to achieve here?

I’m not sure if I can understand what you are to referring here.

Looking forward to helping you.


Roberta Biese

May 30, 2024 at 7:35 am

I’m trying to have the sort ignore the word “The” at the beginning of the title name. I can remove “the-” from the slug which no one can see and if I can get the sort to read the slug instead of the title, that would solve my problem.


Sam

  • Support Staff

May 30, 2024 at 8:06 am

Hi there,

You need to edit the single event and there you can find the option to edit the event slug:
https://tinyurl.com/27o4pvef

If still facing issues, please share a screenshot of the issue and share a direct link to the page so that we can check further.


Roberta Biese

May 30, 2024 at 12:04 pm

I had already tried that. The page that this is happening on is: https://readyaimteach.com/workshops-temp/
The problem is in the second group of courses. If you scroll down to the courses that begin with “T”, you’ll see one called “The ADHD Brain:…”. We want this to show up in the beginning under “A”. Currently, I have removed the word “the-” from the beginning of the slug. But, it’s not reading that. It reads the title.


Tony

  • Support Staff

May 30, 2024 at 4:21 pm

Hi Roberta,

What are you using to query those events?

In short, you need to pass 'orderby' => 'name' to the WP_Query but how you do that depends on what you are using to display those events.

Side note, by default EE would order those by ID or datetime start date/time, we do not order by post title so I’m guessing this is a custom query?


Roberta Biese

May 30, 2024 at 4:35 pm

We’re using the shortcode function of EE directly on the page with the courses. Which is: [ESPRESSO_EVENTS category_slug=2024-summer-asynchronous-courses limit=40 sort=ASC order_by=event_name]


Tony

  • Support Staff

May 30, 2024 at 6:20 pm

What about:

[ESPRESSO_EVENTS category_slug=2024-summer-asynchronous-courses limit=40 sort=ASC order_by=name]

Does that work?


Roberta Biese

May 30, 2024 at 10:08 pm

No. Not really. At first glance, it appears to have worked because the course starting with “The” is at the beginning. However, I’ve noticed that whenever the order_by= doesn’t work at all, this is the default display because that course was the first one entered. So, it simply defaults to the beginning. The other reason I know it’s not working is that if I tell it to sort in descending (DESC) order, nothing changes and that course is still at the begining. Also, there’s a course that starts with “Creating Calmer Classrooms:…” and it’s not with the courses that start with “C”. It’s down just before “M”. So, the only sort that seems to have any affect is when using order_by=event_name. It’s also supposed to support order_by=event_id. But, that also defaults to no sort at all. UPDATE: I changed it to order_by=ID (Must be CAPS) and it now displays in that order which actually for now, gives the result we’re looking for. The problem will be if new courses are added, they won’t be in alphabetical order and I don’t see any easy way to change the order of the courses. I was hoping one could simply drag-and-drop the courses in a different order. But, no such luck.


Rio

  • Support Staff

June 2, 2024 at 11:25 pm

i tried [ESPRESSO_EVENTS category_slug=2024-summer-asynchronous-courses limit=40 order_by=event_name sort=ASC] and everything seems fine on my end. Can we look on your site why this parameter doesn’t work as you reported? I’m wondering if you add any custom code affecting it.

Let me know if you have staging site we can use to check this.

thanks

Viewing 8 reply threads

The support post ‘sort order, slug’ 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