Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Prioritise a certain category › Reply To: Prioritise a certain category
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.