Answer the question
In order to leave comments, you need to log in
How to sort posts in Wordpress but if nothing is found then posts are shown anyway?
There is such a form with various filters.
As it works now, when we sort records and nothing was found for this field "Square Feet" (although there are records for other fields), wordpress does not return anything. Since the sorting goes on the field (Square Feet) which is not in the records.
Code responsible for sorting.
You need to make sure that the records are still displayed.
Has anyone come across such a situation?
Answer the question
In order to leave comments, you need to log in
If the request for filters is empty, display the standard
. In general, you can add Square Feet like an arbitrary field and display it according to it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question