This file contains hidden or 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
| <?php | |
| add_filter( 'facetwp_index_row', function( $params, $class ) { | |
| if ( 'has_image' == $params['facet_name'] ) { | |
| $post_id = (int) $params['post_id']; | |
| if ( has_post_thumbnail( $post_id ) ) { | |
| $params['facet_value'] = 1; | |
| $params['facet_display_value'] = 'Has photos'; | |
| } |
This file contains hidden or 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
| <script> | |
| (function($) { | |
| $(document).on('facetwp-refresh', function() { | |
| if (! FWP.loaded) { | |
| FWP.temp_set_hash = FWP.set_hash; // on init, save a backup of FWP.set_hash() | |
| } | |
| if (FWP.is_reset) { | |
| FWP.set_hash = FWP.temp_set_hash; // on reset, store FWP.set_hash() | |
| } | |
| else { |
This file contains hidden or 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
| <?php | |
| add_filter( 'gettext', function( $translated_text, $text, $domain ) { | |
| if ( 'fwp-front' == $domain && 'Go' == $text ) { | |
| $translated_text = 'Go (russian)'; | |
| } | |
| return $translated_text; | |
| }, 10, 3 ); |
This file contains hidden or 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
| <?php | |
| // Add to your (child) theme's functions.php | |
| // woocommerce_rest_{$this->post_type}_object_query | |
| add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
| if ( false !== strpos( $_SERVER['REQUEST_URI'], 'wp-json/wc/v3' ) ) { | |
| $is_main_query = false; | |
| } | |
| return $is_main_query; |
This file contains hidden or 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
| <?php | |
| // Add to your (child) theme's functions.php | |
| add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
| if ( false !== $query->get( 'showposts', false ) ) { | |
| $is_main_query = false; | |
| } | |
| return $is_main_query; | |
| }, 10, 2 ); |
This file contains hidden or 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
| <?php | |
| // Add to your (child) theme's functions.php | |
| add_action( 'pre_get_posts', function( $query ) { | |
| if ( 'providers' == $query->get( 'post_type' ) ) { | |
| $query->set( 'orderby', [ 'menu_order' => 'ASC', 'date' => 'DESC' ] ); | |
| } | |
| }); |
This file contains hidden or 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
| <?php | |
| // Add to your (child) theme's functions.php | |
| add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
| if ( $query->is_post_type_archive( [ 'opleidingen', 'cursussen', 'groepsleertherapie' ] ) ) { | |
| $is_main_query = false; | |
| } | |
| return $is_main_query; | |
| }, 10, 2 ); |
This file contains hidden or 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
| <?php | |
| // Add to your (child) theme's functions.php | |
| add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
| if ( $query->is_tax( 'job_listing_category' ) ) { | |
| $is_main_query = false; | |
| } | |
| return $is_main_query; | |
| }, 10, 2 ); |
This file contains hidden or 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
| <?php | |
| // Add to your (child) theme's functions.php | |
| add_filter( 'facetwp_pre_filtered_post_ids', function( $post_ids, $class ) { | |
| $facet_name = 'senior_living_proximity'; | |
| if ( empty( $class->facets[ $facet_name ]['selected_values'] ) ) { | |
| $post_ids = [ 0 ]; // force a 0-filled (empty) array | |
| } |
This file contains hidden or 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
| <?php | |
| // Add to your (child) theme's functions.php | |
| add_filter( 'facetwp_builder_item_value', function( $value, $item ) { | |
| if ( 'post_title' == $item['source'] ) { | |
| $excerpt = get_the_excerpt( $GLOBALS['post']->ID ); | |
| if ( ! empty( $excerpt ) ) { | |
| $value = ''; // clear the layout builder item value |