• Resolved HannaW

    (@hannaw)


    Hello,
    Thanks for a nice plugin. I would like to get the map to load results from a bigger radius than 1000 miles. Reading an old answer, I found the reply to add the filter:

    function my_custom_sm_radius_choices( $original ) {
    return array( 1, 10, 25, 50 );
    }
    add_filter( ‘sm-search-radii’, ‘my_custom_sm_radius_choices’ );

    But that limits the radius down when I tried it. Is it possible increase it?

    • This topic was modified 8 years, 1 month ago by HannaW.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Steve M

    (@wpsmort)

    You have the correct code, you just need to change the returned array like so:

    `
    // Return the available search_radii
    function change_sm_search_radii( $search_radii ){
    $search_radii = array( 100, 500, 1000, 2000 );
    return $search_radii;
    }
    add_filter( ‘sm-search-radii’, ‘change_sm_search_radii’ );
    `

    Thread Starter HannaW

    (@hannaw)

    Thank you so much for your reply! In a search, the results is still is max 1000 miles away. Is it possible to load results from the whole world as a default?

    • This reply was modified 8 years, 1 month ago by HannaW.
    • This reply was modified 8 years, 1 month ago by HannaW.
    Plugin Author Steve M

    (@wpsmort)

    Use the code I provided, changing the highest number to 20000 and then set the Default Search Radius under plugin settings to 20,000 and set the Default Zoom Level to 2 and Number of Results to Display to No Limit.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Increase results radius on load’ is closed to new replies.