Lower a category’s weight
-
I’m trying to severely lower a category’s weight so that any posts associated with that category will show at the end of the results.
// custom code for relevanssi I added
add_filter( 'relevanssi_match', 'rlv_boost_one_term' );
function rlv_boost_one_term( $match ) {
if ( has_term( 'latest-news', 'category', $match->doc ) ) {
$match->weight -= 10;
}
return $match;
}Here’s the code I attempted using the documentation, but it doesn’t seem to change the search results at all, still all the same. My “weights” are still the default from install, so no changes, I figured removing 10 from this category would have those specific posts drop off, but it doesn’t.
Any help is appreciated.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Lower a category’s weight’ is closed to new replies.