Too many nested wp_query loops in this hypothetical query?

When you need to retrieve and present a lot of information there is bound to be complexity. Mostly it is finding right balance between complex querying and complex sorting in PHP (which is often overlooked option).

Your logic looks mostly fine, what could use tweaking as for me:

  • Genre seems more like a taxonomy than custom field;

  • you are essentially building post relationships here and might be better of just using one of relationships plugins, rather than trying to handle it with custom fields. It seems easy enough now, but add more CPTs into the mix and it might fall apart.

Leave a Comment