Forum: F.A.Q

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support and general questions related to GEO my WP plugin and its core add-ons please use the support forum.

[Feature request]Post Locator Order-by Filter Not Displaying

Forums F.A.Q Post Locator Order-by Filter Not Displaying

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
  • #39270

    I read the tutorial on how to create an order-by dropdown filter here:

    But it doesn’t seem to be working. I have placed the following code in my functions.php file:

    I thought using the action hook in the first function would automatically display the filter above the distance dropdown in a search form but it did not. I also tried using gmw_orderby_dropdown( $gmw ); in the search form template but this also does not display anything.

    Do I have an error in my code somewhere, or am I missing something?





    Hello Squints,
    Looks like the code in this tutorial is “broken”. I will need to update this page and I will do so after the release of Geo my WP 2.6.1. I will update you once I update the tutorial so you can check the script again.


    Okay thanks.

    I got certain aspects of the dropdown filter to work by just building a simple dropdown selector in the search form using the <select> tags then using the provided php function in functions.php. But the code for the actual dropdown doesn’t work.

    But I also really need to know how to add a custom option to the sort dropdown. I am attempting to add the ability to sort by a meta value but cannot get it to work.

    Here is the code I have tried:


    But these return no results.

    So how do I add a sort option using a meta value in the functions.php code you have provided?




    I apologize but I am currently out of the country and I don’t have a way to look into the code or test it at the moment. So I really have no way to help you with this script above.

    However, iT does look like you are in the right direction.


    When will you be able to look at/test the code?



    BY the end of this month.


    I was hoping you would have a solution by the end of the month as you claimed.  Are you going to provide a solution for this?


    I will take a look it within a few days. I just arrived back in the country and I am now taking care of few urgent bugs found in the latest version of GEO my WP.


    Okay I will be eagerly waiting.



    I have realized that the reason the sort method is not working is something to do with the GMW url parameters.  If I am displaying a loop of posts outside of GMW and append ?r_sortby=highest_rated to the URL then the posts are properly sorted by the meta value. But since GMW uses the URL param ?gmw_orderby= I cannot get the sort to work. I have tried passing ?r_sortby=highest_rated in GMW and it results in an error page and when using ?gmw_orderby=highest_rated it is not recognized.

    So how can I pass the URL param ?r_sortby=highest_rated for this one sort option instead of the default ?gmw_orderby= ?


    Can you please update the tutorial or at least just answer how to add a filter option based on meta data to the existing code? It’s been a month and a half already…

    I have been putting off purchasing 2 of your Add-ons that I need because I can’t even get support for a simple question.


    Hi Squints,
    I updated the code in the tutorial. However, it looks like you will need to go a different direction if you want to order by meta_key. You will need to modify the WP_Query instead of the location query clauses.

    Below is the WP_Query that GEO my WP creates:

    You will need to use the filter ‘gmw_pt_search_query_args’ to modify the WP_Query args based on the order that you need.

    This should give you a start point. Other than that I will need to rewrite the tutorial based on this example and that I will be able to do only once I am done with all the updates and bugs fixes.


    Okay thank you for the reply. Are we getting close to a solution for the default value issue addressed in this topic:

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.