This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Prioritise a certain category

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Prioritise a certain category

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #7683
    bellyfeelbellyfeel
    Participant

    Hi ,

    I am testing your plugin on a new site (having bought it previously and found it to be excellent!)

    I want to know if I can prioritise a certain category to appear before all other categories – I can see that i can set individual posts to be prioritised: https://wpdreams.gitbooks.io/ajax-search-pro-documentation/content/priority_settings.html – this would take me some time as there are very many posts to amend.

    So is there a way to simply promote one category’s relevant posts to appear before all others in the results?

    Thanks,

    Krish

    #7708
    bellyfeelbellyfeel
    Participant

    Hi Again,

    I really want to rebuy this plugin – any chance of finding our if I can prioritise a certain category to appear before all other categories – I can see that i can set individual posts to be prioritised: https://wpdreams.gitbooks.io/ajax-search-pro-documentation/content/priority_settings.html – this would take me some time as there are very many posts to amend.

    So is there a way to simply promote one category’s relevant posts to appear before all others in the results?

    Thanks,

    Krish

    #7712
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    I’m sorry I have forgot to reply to your ticket on friday.

    I have been trying to figure out a solution yet, that does not involve too much coding, but I couldn’t. The current state of the priority code does not work this way.

    What I do in this case, is suggest a modification to the actual search code part. That solution would completely ignore all priority settings, and give a higher priority to the given category ID. I don’t know if that would solve your problem, because every other priority setting would be ignored. Let me know if that would be ok, and I will put together a modification.

    #7713
    bellyfeelbellyfeel
    Participant

    Hi Ernest,

    Thanks for getting back to me – that would be a perfect solution. If it’s possible I would be super pleased.

    Thanks,

    Krish

    #7724
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #7727
    bellyfeelbellyfeel
    Participant

    thanks- we will give this a go and let you know how we get on… much appreciated for your help!

    #7749
    bellyfeelbellyfeel
    Participant

    You cannot access this content.

    #7766
    bellyfeelbellyfeel
    Participant

    Hi Ernest!
    Hope you’re well. I looked through the files in plug-ins folder and couldn’t find the code that you showed me. I really hope we can make it work..

    Cheers,
    Bellyfeel

    #7767
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    Sorry, I did look at the code but it seems like it might be an older version of the plugin. It’s going to be a bit more difficult, but try locating exactly this code:

    [code]CASE WHEN " . $_prefix . "ajaxsearchpro_priorities.priority IS NULL
    THEN 100
    ELSE " . $_prefix . "ajaxsearchpro_priorities.priority
    END AS priority,[/code]

    and then replacing it with this one:

    [code]IFNULL((
    SELECT 1000
    FROM $wpdb->term_relationships as xt
    INNER JOIN $wpdb->term_taxonomy as tt ON ( xt.term_taxonomy_id = tt.term_taxonomy_id AND tt.term_id = 99999)
    WHERE
    xt.object_id = $wpdb->posts.ID
    ), 100) AS priority,[/code]

    and replace the 99999 with the category ID you want to prioritize. ( end of 4th line in this code )

    I’m not sure if this is going to work, but give it a try.

    #7768
    bellyfeelbellyfeel
    Participant

    Will do, thank you!

    #7794
    bellyfeelbellyfeel
    Participant

    Hello Ernest,
    I tried it and it didn’t work. What do you think is the way to achieve the priority categories goal?

    PS.
    Thanks for all your help, you have a very reliable support.

    Bellyfeel

    #7796
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    I think this is the best and easiest way. If you can provide temporary FTP access and the category ID in question, I can try to make the modification for you and see if that works.

    Please note that I will be unavailable in the next 5 days, so my answer might be delayed to 29th of february.

    #7799
    bellyfeelbellyfeel
    Participant

    You cannot access this content.

    #7800
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #7802
    bellyfeelbellyfeel
    Participant

    You cannot access this content.

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.