Prioritise a certain category

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

This topic contains 16 replies, has 2 voices, and was last updated by

 
Keymaster
5 years, 11 months ago.

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

    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

    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

    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.

    Best,
    Ernest Marcinko

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


    #7713

    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
    You cannot access this content. Best,
    Ernest Marcinko

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


    #7727

    Participant

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

    #7749

    Participant
    You cannot access this content.
    #7766

    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

    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:

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

    and then replacing it with this one:

    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,

    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.

    Best,
    Ernest Marcinko

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


    #7768

    Participant

    Will do, thank you!

    #7794

    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

    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.

    Best,
    Ernest Marcinko

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


    #7799

    Participant
    You cannot access this content.
    #7800
    You cannot access this content. Best,
    Ernest Marcinko

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


    #7802

    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.