Search Function

This topic contains 9 replies, has 4 voices, and was last updated by  Stiofan O’Connor 9 years, 5 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #37920

    punchtownparry
    Expired Member
    Post count: 29

    Is there anyway to make the search results only display categories, tags and listing title and not search the content (main body of text)?

    #37957

    Paolo
    Site Admin
    Post count: 31206

    Not without rewriting the Search Widget and its query.

    Thanks

    #44404

    Jen Thomson
    Buyer
    Post count: 145

    Just come across this post while searching how to do this myself. Client doesn’t want users to be able to search things in profile body copy, just in categories and tags.

    I see that you can post jobs on the forums. Would there be any issues you foresee with having this customised or would you advise against it for futureproofing?

    Cheers,
    Jen

    #44477

    Paolo
    Site Admin
    Post count: 31206

    Hi Jen,

    I see plenty of hooks in both the search widget class and the template it uses. However I need to ask confirmation to Stiofan to be 100% sure.

    We’ll keep you posted.

    Thanks

    #44479

    Jen Thomson
    Buyer
    Post count: 145

    Great, thanks Paolo. Much appreciated!

    #44570

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    There is currently not a way to do this, i have added a couple of hooks that will allow this, they will be in the next ver but if you want it now you can replace this file in core:
    https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/listing_filters.php

    and then add this code to your theme functions.php

    
    
    function my_theme_change_search(){
    return "";
    }
    add_filter("geodir_search_content_where", "my_theme_change_search",10);

    Thanks,

    Stiofan

    #44574

    Jen Thomson
    Buyer
    Post count: 145

    Hi Stiofan,

    Thanks for the reply. So I can either wait until the next release or hire someone to rewrite listing_filters.php, is that correct?

    When is the next release out?

    Cheers,
    Jen

    #44576

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Jen, u just need to replace that file via FTP, if you email me wp-admin and FTP details i’ll apply it for you if you want? (info at wpgeodirectory.com) Or you can wait till the next release, it should be early/mid next week.

    Stiofan

    #44584

    Jen Thomson
    Buyer
    Post count: 145

    Oh thanks very much Stiofan. I can do that, I didn’t realise that was the updated version you were linking to.

    #44592

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    OK, great 🙂

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