Forums › Forums › Search & Filter Pro › Post Meta OR option?
Tagged: field relationship, meta_query, or, post meta, post meta arguments
- This topic has 11 replies, 2 voices, and was last updated 9 years ago by
Anonymous.
-
Anonymous(Private) June 22, 2016 at 3:42 pm #49184
Okay!
So, if you look at the current search page: http://devvy.site/search/ you can see it’s returning a nice list of all my posts, for all my various post types.
However, I want it to exclude posts marked as “archived” using the above meta_query.
If you go into Search & Filter settings for my “Search Archive” form and add back my arguments (as above), it breaks the search page and returns no results.
The behaviour I’d expect is for it to return all the posts EXCEPT “This is a test post” (at the bottom), which is currently the only marked as archived.
Yell if that doesn’t make sense!
Trevor(Private) July 4, 2016 at 3:17 pm #50145Jon
This one escaped me, does it still need my action? I spoke to Ross and currently the way the logic works what you want can’t work. In effect, what you need is a way of testing is a field value has NOT been set or is empty. At least, that’s what Ross and I read into what you asked for. If we are right, this will need to go into feature requests and join that long line of features to be added.
Anonymous(Private) July 6, 2016 at 11:52 am #50310It does, unfortunately.
Yeah, that’s right. I need a way of displaying posts with a certain meta value OR that don’t have that meta field.
So that’s not what the current args are setup for? There IS a no exists option, I’d assumed that this was what it was for.
That’s really disappointing.
I’ll add it to the feature request list, but my client isn’t going to be happy that it doesn’t do what we thought it did.
Thanks anyway, Trevor.
Trevor(Private) July 6, 2016 at 1:13 pm #50314The only way of doing this for now is putting a meta value in a field for all posts, and having a key field value that you exclude by. I think in ACF you could even do this by way of a default value (any existing posts you would have to add the value by hand, but new posts would have the default set).
-
AuthorPosts