Hiding the Custom Post Type (CPT) selector

This topic contains 9 replies, has 3 voices, and was last updated by  Guust 6 years, 9 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #432305

    adminparentland-pt
    Expired Member
    Post count: 172

    Hi,

    I am trying to hide the Custom Post Type (CPT) selector from listings and search results.

    Tried this
    .gd-search-input-wrapper.gd-search-field-cpt {display: none;}

    but didn’t get any effect…

    This one works, but everywhere, which is not what I want

    .search_by_post {
    display: none;
    }

    Can you please advise what I might be doing wrong?

    Thanks

    #432320

    Alex Rollin
    Moderator
    Post count: 27815

    We need to see the URL to help you with that.

    You can make a private reply and share the site URL so we can take a look.

    #432321

    adminparentland-pt
    Expired Member
    Post count: 172
    This reply has been marked as private.
    #432334

    Guust
    Moderator
    Post count: 29970

    Try this CSS:

    
    
    .archive .gd-search-field-cpt,
    .search .gd-search-field-cpt {display: none;}

    Thanks

    #432350

    adminparentland-pt
    Expired Member
    Post count: 172

    Thanks Guust,

    I used search_by_post instead of gd-search-field-cpt and that allowed to keep the category selectorand just remove the CPT selector!

    Thanks

    #432353

    Guust
    Moderator
    Post count: 29970

    Glad we got it sorted 🙂

    #432388

    adminparentland-pt
    Expired Member
    Post count: 172

    One issue I found with this: while the search_by_post input is hidden, it is still taking space, so my search bar is misaligned. I can correct this with margin-left, but is there a more elegant way? I am afraid that using margin-left will render viewing problems in different platforms…

    #432395

    Guust
    Moderator
    Post count: 29970

    Try this

    
    
    .archive .gd-search-field-cpt,
    .search .gd-search-field-cpt {display: none;}
    .archive .gd-search-field-taxonomy, .search .gd-search-field-taxonomy {display: initial !important;}
    #432465

    adminparentland-pt
    Expired Member
    Post count: 172

    Brilliant, works like a charm! Thanks!

    #432467

    Guust
    Moderator
    Post count: 29970

    You’re welcome 🙂

Viewing 10 posts - 1 through 10 (of 10 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