Is it possible to change the default order from “created_date” to “modified_date” in an easy way?. I have successfully done it by editing the render function in “includes\blocks\class-listings.php” but I want to avoid this method.
Is is posible to do it by any other way? For example:
A simple filter in functions.php to change the block. Maybe with an action?
Is it possible to redefine the whole public function “render()” in this functions.php.
I have been testing with these two options with no results.
If you’re familiar with customizations, I recommend using the pre_get_posts hook, you can check if it’s the main query there and if the post type is hp_listing, then adjust the query in any way. Another solution is using the hivepress/v1/models/listing/search hook, but in the current version it fires only if the search is performed, not when the common Listings page is being viewed.