Set Custom Post Type on Search form

This topic contains 6 replies, has 4 voices, and was last updated by  Alex Rollin 5 years, 12 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #427423

    Vladimire Calixte
    Free User
    Post count: 85

    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?

    #427429

    Paolo
    Site Admin
    Post count: 31206

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #427515

    Kiran
    Moderator
    Post count: 7069

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #427516

    Vladimire Calixte
    Free User
    Post count: 85
    This reply has been marked as private.
    #427559

    Vladimire Calixte
    Free User
    Post count: 85

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #427570

    Vladimire Calixte
    Free User
    Post count: 85

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #427590

    Alex Rollin
    Moderator
    Post count: 27815

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket