• Resolved 4bimcad

    (@4bimcad)


    Hello.
    Please tell me why I get 404 error when trying to search by location?
    For example I write “Peru”, I have articles, but get 404 error. https://polimetal.club/?location=peru
    But this is strange, because when you search by article title, everything works fine. Console saying cant find jquery.
    Thanks for attention.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    this seems to be conflict with the Events Manager plugin installed on website, you should be able to fix it by renaming the “location” field in the [adverts_list] shortcode.

    You can do that by adding the code below in your theme functions.php file

    
    add_filter( "adverts_form_load", function( $form ) {
        if( $form["name"] != "search" ) {
            return $form;
        }
        foreach( $form["field"] as $k => $field ) {
            if( $field["name"] == "location" ) {
                $form["field"][$k]["name"] = "search_location";
            }
        }
        return $form;
    } );
    add_filter( "adverts_list_query", function( $args, $params ) {
        $location = adverts_request("search_location");
        if($location) {
            $args["meta_query"][] = array('key'=>'adverts_location', 'value'=>$location, 'compare'=>'LIKE');
        }
        return $args;
    }, 5, 2 );
    
    Thread Starter 4bimcad

    (@4bimcad)

    Thanks for fast answer and Support!!!!
    I will do it.
    All the best to you and success!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘find location – error 404’ is closed to new replies.