We are building a directory for Therapists and Coaches. Each of these is set up in Geodirectory as a custom post type. Our Find a Therapist page search is working great because Therapist is the default. However, on our Find A Coach page, we want to avoid the step of changing from Therapists to Coaches in the search form here:
https://therapyforblackmen.press/find-coach/
We have tried to set this using the following code:
jQuery(“.page-id-11488 .gd-search-field-cpt select>option:eq(1)”).attr(‘selected’, true);
jQuery(‘.page-id-11488 .gd-search-field-cpt select).change();
The first part alone does set the dropdown value to ‘Coaches’ but does not trigger any change (Therapist options still showing). When the second line is added, the drop-down shows no value and the form options don’t change either. Can you help us with this? Is there a better alternative than using code like this?