Itamar Peretz
Forum Replies Created
-
AuthorPosts
-
Hey Guust, thanks for the reply.
I know that’s what I need to do, I’m looking for a best practice solution for this purpose – I’d be happy if you can provide any, since the link you posted handles with disabling reviews.Thanks once again.
Hey,
we’ve got it working.Thanks for helping, we truly appreciate it.
This reply has been marked as private.Hey, once again thanks for the quick reply.
I’m afraid you are wrong – I’ve chosen a sorting order and still the request array is empty.
A print screen with that shows the url with chosen sort type and the empty $sort_by value using your code is attached.Thank you.
Stiofan, thanks for the reply.
I think the source of the problem is different –
the $_REQUEST array is empty on the geodir_posts_orderby function in listing_filters.php .
Because it’s empty, the following flow will always skip the first condition and execute the second :if (isset($_REQUEST[‘sort_by’]) && $_REQUEST[‘sort_by’] != ” && is_main_query())
$sort_by = esc_attr($_REQUEST[‘sort_by’]);if ($sort_by == ”) {
$default_sort = geodir_get_posts_default_sort($geodir_post_type);
if (!empty($default_sort))
$sort_by = $default_sort;
}And that’s the reason why $sort_by is always equal to $default_sort.
Do you have any idea why would the $_REQUEST array be empty ?
This reply has been marked as private.In listing_filters.php, geodir_posts_orderby function, there’s a variable named $sort_by.
I’ve dumped it into screen, and no matter what sort parameter I choose, it’s value remains “string(30) “geodir_special_offers_text_asc” – and I believe that’s the problem.I’d be grateful if you guys have any idea why it happens.
The customization only deals with the way posts are disaplyed, i.e – html and css, the sorting query results should not be influenced at all.
Can you please point me to the function that is responsible for pulling the sorting results?Thanks in advance.
-
AuthorPosts