Searching by Custom Post Type

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Searching by Custom Post Type

This topic contains 9 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 year, 9 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #38173
    Philip Murray
    Philip Murray
    Participant

    hi Guys

    Just to explain the issue more fully – the demo site is built using a genesis framework child theme on wordpress

    it contains lots of records within multiple custom post types – these all have archive pages https://xenopus.fdmserver.com/antibody for example. So they are not conventional Categories really but archive pages for Custom Post types

    in the top header of the site I have used a plugin called Advanced Better Search ACF to show the site wide search box field – it returns results that are fuzzy [ie: if you search for noggin you see the single result for noggin along with results for nog etc etc — so that is working as planned]

    But i purchased Ajax Pro to enable me to provide searches within specific custom post types — so when you browse to a custom post type archive page like https://xenopus.fdmserver.com/antibody you can see the Ajax search box and I have added checkboxes for the custom post types.

    But here are the issues I am trying to resolve;

    1: I do not want the custom post types all checked initially – how do I uncheck them please so the user can decide which ones to select?

    2: If i perform a search and select one of the custom post type check boxes it seems to be pulling in results from other custom post types also – how can they be confined to just the selected post type or indeed if I select more than one custom post type – I only want the selected ones to return results. I want to retain the fuzzy aspect of the results [as explained above] but only within selected categories.

    3: How do i change the layout of the checkboxes so they run horizontally in 2 or 3 rows please rather than vertically?

    4: Can the results be grouped by Custom Post Type? so if I select say Plasmids and Antibodies and enter a search string – can the results be grouped by CPT?

    I would appreciate your help with all the above please — i am trying to get this resolved today for the client

    Thanks

    Philip

    #38186
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Philip,

    1. For post types, make sure nothing is selected under the General Options -> Sources panel: https://i.imgur.com/FAe5pki.png
    That will automatically make the checkboxes unchecked. It is a bit counter intuitive, we are reworking the whole front-end system right now.

    2. If you are reffering to the search results page, then make sure the search override feature is enabled and the medhot is set to GET.

    3. The code I suggested was for category checkboxes, my mistake. This should do the trick:

    .asp_filter_cpt {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .asp_filter_cpt .asp_simplebar-content {
        display: flex !important;
        flex-wrap: wrap;
    }
    
    .asp_filter_cpt .asp_option {
        margin-left: 0 !important;
    }
    
    .asp_filter_cpt legend {
        width: 100%;
    }
    
    .asp_filter_cpt .asp_option .asp_option_label {
        white-space: nowrap;
    }

    4. On the live results list it is possible, this documentation will help with that. The results page layout can not be affected by the plugin.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #38189
    Philip Murray
    Philip Murray
    Participant

    THANKS ERNEST

    I wil try this now and get back to you asap

    regards

    Philip

    #38191
    Philip Murray
    Philip Murray
    Participant

    superb Ernest! i think that is working now – a coupe more queries

    1. please see screenshot – is there a way to HIDE specific Custom Post Types from showing in the list of checkboxes? Line and XLA Line for example

    2. is the a SELECT ALL option i can include so that if checked it will search all Custom Post types

    3. Can the search still be fuzzy? i selected OR and OR for the Primary and Secondary logic matching scenarios – is that the right way to ensure that if someone searches for NOGGIN in a post type that they will also retrieve NOG etc etc — screenshot attached also

    thanks

    Philip

    Attachments:
    You must be logged in to view attached files.
    #38194
    Philip Murray
    Philip Murray
    Participant

    hi Ernest

    just to clarify — if I select the Custom Post Types Plasmids and Xla Transgenics — then search for the term ‘Noggin’ it should return both noggin and nog results — ie: a fuzzy search

    is that possible?

    at present it only returns the one result for noggin – see screenshot

    Regards

    Philip

    Attachments:
    You must be logged in to view attached files.
    #38200
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    1. You can choose them here: https://i.imgur.com/kwUykfC.png
    2. Yes, here: https://i.imgur.com/yqk9NHg.png
    3. The default logic “AND” is “fuzzy” by itself. It is a partial matching logic, and also every entered keyword must match at least partially somewhere in the selected fields. I recommend using that, it usually gives the best expected results. You can check this documentation for more in-depth details.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #38201
    Philip Murray
    Philip Murray
    Participant
    You cannot access this content.
    #38202
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #38203
    Philip Murray
    Philip Murray
    Participant
    You cannot access this content.
    #38204
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.