Reply To: Prioritise a certain category

#7767
Ernest Marcinko
Ernest 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:

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 :)