Only have one custom post type show up in a search?

This topic contains 3 replies, has 2 voices, and was last updated by  Paolo 10 years ago.

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

Open Support Ticket
  • Author
    Posts
  • #16116

    physicaltherapistcom
    Full Member
    Post count: 35

    Greetings,

    I’m trying to add two different directories, each with their own search criteria. This would be for “clinics” and “schools.”

    The problem that I am having is that it puts both of these in the search criteria. For instance, see this link: http://www.physicaltherapist.com/find-physical-therapy-clinics/

    When you’re on the clinics page, I do NOT want the schools to show there. I only want clinics to be searched and then only schools to be searched on it’s respective page.

    Is there a way to change this so it does not happen. Please advise.

    Thanks.

    #16157

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    that’s how it works. You can only search 1 CPT at a time. That select only allows to move from 1 to the other.

    You could hide the select option with css:

    
    
    .search_by_post {
        display: none;
    }

    Let us know,

    Thx

    #16260

    physicaltherapistcom
    Full Member
    Post count: 35

    Hi Paolo,

    I considered hiding that with css, however, if I do that will it tell the difference of what post type I want to search or will it search all?

    For instance, on the clinic page, I want to search only clinics, and on the schools page, I want to search only schools. Will this work that way?

    #16282

    Paolo
    Site Admin
    Post count: 31206

    Yes it will.
    Thx

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount