So I know with ids you can pass in multiple values but it would be great to do the same with ?wpv-pr-child-of=XXX filters on a view.
I have a test page here and the first one shows the child of 1803 but the second link does not because it only supports passing in a single parent.
hidden link
hidden link
If we talk about a Custom Filter in the View, you can do that.
When you insert a Custom Filter for a Post Relationship, you can actually choose how the Filter Should look alike, right?
Well, there is alos a "multiselect" option.
This allows you exactly that:
- Filter by several parents.
The URL parameter then just gets added twice to the URL.
Hello Beda, as soon as I select the Post relationship filter, I don't get the same options as you do when you select a custom field. I don't see any way in custom fields to select the parent by id for example. I see I could select a non-ID field from the parent as long as it is a types custom field I add. I would assume even selecting that parent custom field would not help since you are not telling the view this is a parent relationship. But yes if could do a custom query using a post relationship filter that would work for my needs. Am I missing something? I could create screenshots if it would help.
Alex ~hidden link
Yes, you are missing that you can already search by multiple Parent Posts.
I added a screenshot.
I seem to miss what you mean, or I misexplained myself and could not pass you the information accurately.
Please let me know, if needed with visual explanations, sometimes I seem to be a bit "slow" 🙁
Oh, that looks like what I need, but I don't know how to get to that screenshot. I don't see how to get there on the views page and I am not using layouts. See my screenshot of what I was referring to.
Ah, no.
My screenshot is from the Custom Filter section, a little more down.
There, select "new filter" and then "post relationship".
The problem is, you cannot pass more than one Post to the Query argument, instead, the Query argument gets added for each Post Queried in a multiple select field.
So the URL looks like this for one post only:
?wpv-url-parameter=your_post
And like this for more than one post:
?wpv-url-parameter=your_post&?wpv-url-parameter=your_post
That is the only way you could "hardcode" this in the Query Filter (you need to call the specific URL with arguments manually in the front end in this case)
I figured it out. I can do it when creating a view and adding custom search. Is there a way to edit an existing view to add this? Not a big deal and you don't need to respond if you don't want to. 🙂
Yeah, of course.
Make sure the Custom Filter section is displayed when you edit the View (otherwise activate it in the Screen Options on top) and then insert it.
If you already inserted a Query Filter for this, delete it before you proceed with adding a Custom Filter.
I had to re-open this ticket, to say this
You are the king!!! Works perfectly. Thanks