Reply To: Prioritise a certain category

Ernest Marcinko
Ernest Marcinko


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:

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

Ernest Marcinko

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