Filter post type archive by connection to specific post from another connected p
I have two post type $post_type_a and $post_type_b connected using a many to may relationship. On the $post_type_a archive page I want to filter the archive to display ONLY the posts that are connected to a specific post of $post_type_b preferably using pre_get_posts() to set the query_vars on the specific post type archive
Real world example:
Two post types: Books, Publishers
On the Books archive I want to display ONLY those posts that are connect to a specific Publisher (eg. Random House). So any book that is connected to another publisher another than Random House would NOT be displayed on the Books Archive Page
- The topic ‘Filter post type archive by connection to specific post from another connected p’ is closed to new replies.