Sort by featured in result

This topic contains 7 replies, has 3 voices, and was last updated by  Lise Kryger 5 years, 2 months ago.

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

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #473767

    Lise Kryger
    Expired Member
    Post count: 11

    Hi

    I try to make my result sort by Featured – https://slipangsten.dk/find-angstbehandler/?geodir_search=1&stype=gd_place&s=+&snear=k%C3%B8benhavn&sgeo_lat=55.6760968&sgeo_lon=12.568337199999974

    I would love if my results were sorted by Featured, Random. I have added Featured and Random in the Place settings. But nothing themes to happen in my results. Featured is set as default but still, nothing happens.

    How can I make Featured as default sorting? Do I need to add something in the functions.php or what should I do?

    Kind Regards
    Peter Terp / Lise Kryger

    #473770

    Guust
    Moderator
    Post count: 29970

    Search results are always relevant to the search criteria.
    Sorting only works on Listings pages like https://slipangsten.dk/angstbehandlere/

    Thanks

    #473772

    Lise Kryger
    Expired Member
    Post count: 11
    This reply has been marked as private.
    #473774

    Lise Kryger
    Expired Member
    Post count: 11

    Hmm strange it seems like I cant add a comment, it says I already did it – but nothing is shown.

    Yes that looks good, but when I search it doesn’t take the sort_by=featured_desc doesnt’ affect the search result. I would expect that if I search on a search engine.

    Another thing is that if I have a featured listing, I would expect to get something for that – meaning that when one of my clients pay for a featured listing, they expect to get a highlighted display and that they get first in result. Can I somehow change that by adding some php code in the functions.php like a hook or something that overrules the order by in the search.

    I have seen an example where you use $wpdb->posts and change the “order by”, to title. But this one is probably located in the wp_postmeta, therefore I am not sure how to overrule the order by.

    Is that possible?

    Another thing – I have attached a piece of code you might find useful for your plugin. It creates a short code which checks the tags on a regular post and compares it to places tags. In that way it shows targeted places. This is very useful when you run a blog 🙂

    Regards
    Peter

    #473805

    Guust
    Moderator
    Post count: 29970

    Yes that looks good, but when I search it doesn’t take the sort_by=featured_desc doesnt’ affect the search result. I would expect that if I search on a search engine.

    You can always place featured listings above the search results like search engines place ads, but the search results are depending on the query of the visitor.

    Featured listings can get preferential treatment on Location and Listings pages and GD Listings widgets. But not in search results.
    It can be done with custom coding, but that is outside support.

    Thanks

    #474019

    Lise Kryger
    Expired Member
    Post count: 11
    This reply has been marked as private.
    #474058

    Alex Rollin
    Moderator
    Post count: 27815

    We don’t have a codex for V2 yet, but the developers will try to give you a hint. Your topic has been flagged for them to review.

    Thanks

    #474312

    Lise Kryger
    Expired Member
    Post count: 11

    thanks a lot 🙂

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

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

Open Support Ticket