Snippets: WP Query

Basic WP-query

As basic as it gets, for clarity's sake.
WP Query | Type: PHP

CPT to CPT Reverse Query

Reverse query from different post types associated via ACF relationship field.
ACF, CPT, WP Query | Type: PHP

Exclude Posts with a Particular Custom Field Value

You can exclude all posts that don’t have a particular custom field value. In this example, ‘events’ posts with event_type other than ‘Workshop’ will be displayed; [...]
WP Query | Type: PHP

Filter Custom Post Type by Taxonomy

UPDATE: Moving to PHP8 from PHP7.4, there was a problem with the format of the original filter form throwing an error. I have not tested this [...]
PHP, WP Query, WP/CP | Type: PHP

Pre Get Posts

Set up query parameters for different CPT archives.
WP Query | Type: PHP