Exact match

This topic contains 9 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 5 years, 2 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #14934
    splash94
    splash94
    Participant

    Hi,
    try to write “Milano” and then try to search “Milano Marittima”. They are two different cities but when you write Milano Marittima the drivers of Milano appear too.
    Is there a method to let appear only the Milano Marittima drivers?
    Thanks

    #14937
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Probably the easiest and fastest solution would be to simply turn on Exact matches on the General Options -> Logics & Behavior panel: https://i.imgur.com/e64LMsm.png

    I hope this helps.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #14942
    splash94
    splash94
    Participant

    Ok, thanks this helped a lot! But if I write “milano” the last result is the driver of “milano marittima” . Do you know a method to exclude him from the milano search?
    Thank you very much and have a nice day
    Francesco

    #14945
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Francesco,

    Well, there is no configuration to do that, as ‘milano’ will always match ‘milano marittima’. But, there is a way to do that with a custom code. I’ve made a small code snippet for you, that will change the search query arguments and exclude post 16070 aka ‘Transporter Sas’ when the phrase is ‘milano’.

    Add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    IMPORTANT: Before making any direct changes in your site files, please make sure you have a back-up of everything. To edit the files, I highly recommend using an (s)FTP client, instead of the internal file editor in WordPress – as any tiny mistake there can potentially lead to a site error.

    Let me know if you need help with this 🙂

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #14954
    splash94
    splash94
    Participant

    Thank you very much!!! Fantastic!

    #14955
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #15028
    splash94
    splash94
    Participant

    Hi, in italian works great! Is there a method to exclude the phrase beside the uppercase? I mean, I want to exclude “milano” but the script has to exclude also “Milano” and “MILANO”. Just tell if is it possible in a simple way or if I need to add a line for every possibility.
    Thanks
    Francesco

    • This reply was modified 5 years, 2 months ago by splash94 splash94.
    #15031
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Francesco,

    I totally forgot about that possiblity. There is actually a very simple way, no need to add the variations one by one. I have made a change to the code, so now the phrases are converted to lower case before comparison:

    This should work, no matter which letters are lower-upper case.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #15033
    splash94
    splash94
    Participant

    That’s fantastic! Already tested and it works good!
    I’ve rated you 5 stars on codecanyon, fantastic support.
    Thanks a lot
    Francesco

    #15034
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.