Support » Plugin: Relevanssi - A Better Search » Search Problem

  • Resolved shortyjustice

    (@shortyjustice)


    Hey! Thanks for your nice plugin! It works really well and helped me a lot.
    But I have one issue: If I search something on my side and I place a space after the word I searched (what my users can do by accident), like this “Datenschutz “, then the whole side crashes and shows only the search term everywhere. I think it is because the search function converts the space to a “+” in the url. I linked the side down below. Can you help me fix the issue?
    Maybe there is already a solution but I could not find something on the support page.

    Thanks in advance!
    Viktor

    You can see it here!

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Wow, now that’s something I’ve never seen before. I’ve got absolutely no idea what could cause that in the first place.

    Try this:

    add_filter( 'relevanssi_modify_wp_query', 'rlv_trim_query' );
    function rlv_trim_query( $query ) {
        $query->query_vars['s'] = trim( $query->query_vars['s'] );
        return $query;
    }

    Add this to your theme functions.php. Does that solve the problem?

    You are amazing! It solved the problem.
    Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.