Created
August 30, 2016 06:20
-
-
Save whoaloic/f5c1f185212cbd21de8d67145feda5f6 to your computer and use it in GitHub Desktop.
Facet wp index level category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function index_top_level_terms( $params, $class ) { | |
if ( 'univers' == $params['facet_name'] ) { | |
if ( 0 < $params['depth'] ) { | |
return false; // don't index child terms | |
} | |
} | |
if ( 'familles' == $params['facet_name'] ) { | |
if (( 0 == $params['depth'] ) || ( 2 == $params['depth'] )) { | |
return false; // index level 2 terms | |
} | |
} | |
return $params; | |
} | |
add_filter( 'facetwp_index_row', 'index_top_level_terms', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment