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 Ernest Marcinko 7 years, 9 months ago.
- AuthorPosts
- February 11, 2016 at 12:53 pm #7683
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
February 15, 2016 at 1:41 pm #7708Hi 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
February 15, 2016 at 4:43 pm #7712Hi!
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 :)
February 15, 2016 at 8:16 pm #7713Hi Ernest,
Thanks for getting back to me – that would be a perfect solution. If it’s possible I would be super pleased.
Thanks,
Krish
February 16, 2016 at 2:09 pm #7724You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 16, 2016 at 3:15 pm #7727thanks- we will give this a go and let you know how we get on… much appreciated for your help!
February 19, 2016 at 2:13 pm #7749You cannot access this content.February 22, 2016 at 6:31 pm #7766Hi 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,
BellyfeelFebruary 22, 2016 at 6:40 pm #7767Hi!
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 :)
February 22, 2016 at 6:55 pm #7768Will do, thank you!
February 23, 2016 at 4:07 pm #7794Hello 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
February 23, 2016 at 5:18 pm #7796Hi,
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 :)
February 23, 2016 at 7:44 pm #7799You cannot access this content.February 23, 2016 at 9:37 pm #7800You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 24, 2016 at 2:45 pm #7802You cannot access this content. - AuthorPosts
You must be logged in to reply to this topic.