Forums › Forums › Search & Filter Pro › Problem with custom post META
- This topic has 16 replies, 3 voices, and was last updated 5 years, 8 months ago by Anonymous.
-
Anonymous(Private) April 5, 2019 at 9:03 am #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(Private) April 5, 2019 at 9:35 am #207621Trevor,
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(Private) April 5, 2019 at 9:49 am #207625You 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:
As to the ampersand, I will refer this to Ross, our plugin developer, for his input.
-
AuthorPosts