Custom Post Type WP_Query with filters and search

I have a custom post type called “doctor”, this is the query I have set for displaying all the posts in the archive template:

$args = array(
‘post_type’ => ‘doctor’,
‘orderby’ => ‘menu_order’,
‘order’ => ‘ASC’,
‘posts_per_page’ => ’12’
);
$loop = new WP_Query( $args );

The Doctor CPT has two taxonomy’s setup, Specialty and Locations. I also need to allow the users to filter the list of doctors by Specialty and/or Location and have a search box where they can type a name in and search for that name.

I installed Beautiful Taxonomy Filters, but when I select the Specialty or Location it doesn’t change what loads on the page.

I’m looking for a solution that will show all doctors when they first go to the archive page, and the will have the option of narrowing down the list based on their selection.

Read more here:: Custom Post Type WP_Query with filters and search

Leave a Reply

Your email address will not be published. Required fields are marked *