Sort By function only works if a category has been chosen

We have found that when we create a custom date attribute and select it to work as a Sortable function, it will only Sort by the dates if the user has selected (searched) a category first.
If the page is an All Listings search and no category has been selected then trying to Sort by the custom Date does not work.
However, the Sort By price function does always work whether or not a category has been selected.
It therefore appears that custom Sort By functions only work when a category search is selected.

Am I correct in this assumption.

What we are trying to achieve is to make the vendors always enter a date for the listing. The Date they are entering is an END of promotion date. So it has nothing to do with the Date the listing was posted or when the listing expires.

A Snippet or CSS code would be easiest solution unless we have missed a setting somewhere.

Can we have a reply of some kind please.


Please navigate to WP Dashboard > Listings > Attributes and check if this attribute is not linked to the category.

Done Thanks.
For anyone looking at this, here is how we fixed our problem.
We did have attributes linked. However, we needed to create a Parent category as All Categories.
Then we needed to go back and add that All Categories to each of the Attributes.
Now when a visitor goes to any search page (except for the home page) the Sort By function with the Custom Attribute is displayed and works.
We just needed to get our heads around the fact that the Sort By function and Attributes are all category driven.
Thanks for the help again.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.