I have created a custom post type for ‘Rentals’, in which my client can enter their apartment buildings. Each rental property (apartment building) post has a repeater field, in which individual apartments for rent can be listed. One of the subfields is a number, reflecting the monthly rent. A rental property may have 1 available apartment or it could have 3.
The client wants to list each available apartment by to the rent — not according to the property location. So the output might ultimately look like this:
Property A : Apartment 2 : 500
Property B : Apartment 1 : 650
Property A : Apartment 1 : 675
Property C : Apartment 3 : 700
I’ve tried meta queries, but it’s pretty easy to see why it’s not working; I’m sorting independent of the post itself, and that’s proving a problem. If I’d known they’d ask for it this way, I’d have done it differently — but it’s done now.
Can someone point me in the right direction to make this work?
I don’t mind adding in pre_get and filters if necessary, but I haven’t worked with them before — so some guidance would be very appreciated.