Custom Sorting not working on Widgets
This topic contains 10 replies, has 4 voices, and was last updated by Dave 6 years ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
November 2, 2019 at 12:32 pm #515680
Hi guys,
I’ve set up a ‘Recommended’ in the event sorting options which should put any featured events first, then sorted by highest rating, then by date.
It seems to work just fine on an archive page like this one:
https://whatsonhub.co.uk/events/united-kingdom/west-yorkshire/leeds/But in the first “top picks” widget on the home page, I’ve set it to ‘recommended’ sort, but it won’t do the same sort order that it’s supposed to (featured, then highest rating)…
https://whatsonhub.co.uk/city/united-kingdom/west-yorkshire/leeds/Can you help?
Thanks,
DaveNovember 2, 2019 at 12:35 pm #515681This reply has been marked as private.November 2, 2019 at 1:24 pm #515685The widget is set for the next 7 days only.
The events page has all upcoming.
The featured events are not in the next 7 days.Thanks
November 4, 2019 at 1:21 pm #515861Hi Guust,
Just added a ‘featured’ event that’s on this week. Good news is that’s showing first in the ‘top picks’ widget on the home page.
However, the event that has the highest rating that’s on this week, isn’t showing next (it’s not showing until page 3).
Thanks,
DaveNovember 5, 2019 at 12:23 am #515943This reply has been marked as private.November 5, 2019 at 2:48 pm #516004Thanks Guust.
This event… https://whatsonhub.co.uk/events/united-kingdom/west-yorkshire/leeds/leeds-heritage-beer-tour-5/
… is the one that should come directly after the featured events. It does on the events archive, just not on the widget, so looks like it’s obeying the top-level sort, just not the second level.
Thanks,
DaveNovember 7, 2019 at 2:13 pm #516301Hi DAVID,
can you provide any staging link. where we can check by changing data values for events and also FTP details will be helpful.
Thanks
November 8, 2019 at 8:45 pm #516463Hi Naveen,
You can play around with this site just fine. It’s not launched properly yet so everything I have is on here. It’s backed up hourly but if you want to take specific backups by all means (login and FTP details are further up this thread).
You’ll notice too that for some reason, the speed of the site randomly slows down intermittently. I can’t figure out why but when I just managed to find some errors in the console, it was saying it was a GeoDirectory thing. Any chance you can look while you’re there?
Thanks,
DaveNovember 12, 2019 at 8:31 am #516710I am proceeding on site slowdown issue on other ticket.
I will assign the widget issue to kiran. he will be quick here.November 12, 2019 at 11:47 am #516740Hi David,
On archive page it uses secondary sorting used in CPT > Settings > Sorting but on widget it applys only parent sorting.
I have added following PHP snippet to apply secondary level sorting to the widget listings.
/** * Add secondary level sorting to the widget listings. */ function gd_snippet_191112_filter_widget_listings_orderby( $orderby, $table, $post_type ) { global $gd_query_args_widgets; $sort_by = ! empty( $gd_query_args_widgets['order_by'] ) ? $gd_query_args_widgets['order_by'] : ''; $orderby = GeoDir_Query::sort_by_children( $orderby, $sort_by, $post_type ); return $orderby; } add_filter( 'geodir_filter_widget_listings_orderby', 'gd_snippet_191112_filter_widget_listings_orderby', 0, 3 );Please check and let us know.
Regards,
KiranNovember 12, 2019 at 4:55 pm #516793Ok great, thanks Kiran. I’ll take a look.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket