Skip Navigation

[Resolved] Ref: Add custom option in sorting controls dropdown

This support ticket is created 7 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 7 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#576805

With reference to this ticket: https://toolset.com/forums/topic/add-custom-option-in-sorting-controls-dropdown/

One thing I found, when I scroll down the page, the infinite scroll will call and other results will be displayed but the added custom option will not be selected and the descending option is getting selected.
If I not selected anything from sorting by default sort by date is selected but when I scroll down to it will change to descending.
hidden link

#577131

Okay I've tweaked the code a bit to store the initial default state, then change it whenever the sorting filter is modified. Please check now and let me know if we've covered all the use cases. It looks like someone else is modifying code here, so be sure they're aware of the change if modifications are ongoing.