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
<style> | |
.facetwp-facet.facetwp-facet-vehicle_type { | |
margin-bottom: 0; | |
} | |
.facetwp-facet-vehicle_type .facetwp-radio { | |
display: inline-block; | |
background: none; | |
line-height: 48px; | |
width: 120px; | |
margin: 0; |
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
<?php | |
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
if ( 'residents' == FWP()->helper->get_uri() && 'resident' != $query->get( 'post_type' ) ) { | |
return false; | |
} | |
return $is_main_query; | |
}, 10, 2 ); |
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
<?php | |
/* convert state into region */ | |
add_filter( 'facetwp_index_row', function( $params, $class ) { | |
if ( 'region' == $params['facet_name'] ) { | |
$northwest = array( 'WA', 'OR', 'MT'); | |
$northeast = array( 'ME', 'VT', 'MA', 'NH' ); | |
$raw_value = $params['facet_value']; | |
if ( in_array( $raw_value, $northwest ) ) { |
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($) { | |
$(document).on('facetwp-loaded', function() { | |
if ( $().isotope ) { | |
var $container = $( '#tribe-events-photo-events' ) | |
$container.isotope({ | |
itemSelector: '.tribe-events-photo-event', | |
percentPosition: true, | |
masonry: { |
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
<?php | |
/** | |
** only index parent and first level child tax terms | |
** must re-index after adding filter | |
**/ | |
add_filter( 'facetwp_index_row', function( $params, $class ) { | |
if ( 'my_tax_facet' == $params['facet_name'] && $params['depth'] > 1 ) { // channge 'my_tax_facet' to the facet name being indexed | |
$params['facet_value'] = ''; // skip indexing | |
} |
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
<?php | |
// Attempt to preload the days events using a specific link | |
// Link URL should be structured this way http://mercerspace.com/events/?today=true | |
function fwp_preload_facets( $url_vars ) { | |
if( 'events' == FWP()->helper->get_uri() && isset( $_GET['today'] ) && empty( $url_vars ) ) { | |
$url_vars['event_dates'] = array( date( "Y-m-d" ) ); | |
} | |
return $url_vars; | |
} |
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
<script> | |
(function($) { | |
$(function() { | |
if ( 'undefined' !== typeof FWP ) { | |
// Make checkbox options semi-transparent | |
FWP.loading_handler = function(params) { | |
params.element.find('.facetwp-checkbox').css('opacity', 0.5); | |
} | |
} | |
}); |
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
<?php | |
function fwp_update_facets() { | |
?> | |
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
if ( 'trainings-finden' == FWP_HTTP.uri ) { | |
if ( FWP.facets['standort'].indexOf("aarau") > -1 && ! ( FWP.facets['standort'].indexOf("flexibel") > -1 ) ) { | |
FWP.is_reset = true; |
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
<?php | |
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
if ( !in_array( 'hotel', $query->get( 'post_type' ) ) ) { | |
$is_main_query = false; | |
} | |
return $is_main_query; | |
}, 10, 2 ); |
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
<?php | |
add_filter( 'facetwp_query_args', function( $query_args, $class ) { | |
if ( 'gluten_free' == $class->ajax_params['template'] && 'gluten-free-everywhere' == $class->http_params['uri'] ) { | |
$query_args['tax_query'] = array( | |
array( | |
'taxonomy' => 'category', // change 'category' to different taxonomy if needed | |
'field' => 'slug', | |
'terms' => array( 'entertainment', 'travel', 'breakfast-box', 'lunchbox', 'gluten-free-guides' ) // array of term slugs | |
) |