Forums Forums Search & Filter Pro Problem with custom post META

Tagged: , ,

Viewing 10 posts - 1 through 10 (of 17 total)
  • Anonymous
    #207606

    Hi,

    I made a form to be able to search in META for a custom post with a select list.
    Some of the META I select give no result but if I make a search in the text field the result display the result I was supposed to find inside the meta.
    NB: I have installed Relevanssi to be able to search into the meta from the text search field.

    If it’s not clear (my english ain’t so good), here an example:

    Go to: https://clubgravelle.com/membres/

    Try to search into the list “Nom de l’entreprise” : A&C consulting
    You’ll get no result.
    Now search into “Nom du Membre” (plain text): Richomme
    As you can see the result contain “A&C consulting”.

    I was thinking that it can be a problem with the “&” but same thing with others without special characters like “ASCOTEPE” (but if you search with “Nom du Membre” you’ll find it).

    Anonymous
    #207607
    This reply has been marked as private.
    Trevor
    #207617

    The problem with ASCOTEPE is that the field entry in the post also has a space at the end of it.

    Are they the only two with issues, as the ‘&’ may indeed be a problem.

    Anonymous
    #207621

    Trevor,

    is there a way to strip the spaces at the end of the metas? Because it seems my client added space on some and this can be done in the future even I ask here not to add space.

    The “&” doesn’t work but the “?” yes. Is there a way to fix that ?

    Thank you.

    Trevor
    #207625

    You could add some validation using PHP in the child theme’s functions.php file hooked in to the WordPress save_post() function (so it runs when a post is saved and trims any spaces off), but you would need to code this yourself.

    Actually, I think ACF has a way to do this:

    https://stackoverflow.com/questions/31909099/remove-spaces-from-advanced-custom-field-data-on-save-using-act-save-post

    As to the ampersand, I will refer this to Ross, our plugin developer, for his input.

    Anonymous
    #207632

    Thanks for the tips, I will try to find a way to strip spaces.
    Waiting for your return about the “&”.
    Thank you

    Anonymous
    #207748

    Hi Trevor,

    Did you get an answer for this problem ?
    I need to publish my work asap.

    Thank you.

    Trevor
    #207750
    This reply has been marked as private.
    Ross Moderator
    #207829
    This reply has been marked as private.
    Anonymous
    #207863

    Thank you for your help.
    I need to ask why to the dev who made the theme am using if that’s the cause of the problem.

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