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($) { | |
$(document).on('facetwp-loaded', function() { | |
$('.blog-grid').packery({ | |
itemSelector: '.blog-item' | |
}); | |
}); | |
})(jQuery); | |
</script> |
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($) { | |
$(document).on('facetwp-loaded', function() { | |
if (FWP.loaded) { | |
$('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer(); | |
} | |
}); | |
})(jQuery); | |
</script> |
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 | |
$args = array( | |
'posts_per_page' => -1, | |
'post_type' => 'bookshelf', | |
'post_status' => 'publish', | |
'tax_query' => array( // Query on the "Co-Authors Plus" custom taxonomy | |
array( | |
'taxonomy' => 'author', | |
'terms' => $author // the author ID |
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 my_facetwp_render_output( $output, $params ) { | |
$facet_name = 'YOUR_FACET_NAME'; // CHANGE ME | |
foreach ( $params['facets'] as $facet ) { | |
if ( $facet_name == $facet['facet_name'] && empty( $facet['selected_values'] ) ) { | |
$output['settings'][ $facet_name ]['start'] = array( 10, 50 ); | |
} | |
} |
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 index_event_cost( $params, $class ) { | |
if ( 'evenementen_prijs' == $params['facet_name'] ) { | |
if ( function_exists( 'tribe_get_cost' ) ) { | |
$cost = tribe_get_cost( $params['post_id'], false ); | |
$params['facet_value'] = $cost; | |
$params['facet_display_value'] = $cost; | |
} | |
} |
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($) { | |
$(document).on('facetwp-refresh', function() { | |
$('.facetwp-template').animate({ opacity: 0 }, 1000); | |
}); | |
$(document).on('facetwp-loaded', function() { | |
$('.facetwp-template').animate({ opacity: 1 }, 1000); | |
}); | |
})(jQuery); | |
</script> |
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 | |
/** | |
* Context: | |
* Using the Types plugin, the "Resources" post type is a child of the "Courses" post type. | |
* On a Course page, show only Resources belonging to the current Course | |
* | |
* _wpcf_belongs_courses_id | |
* This custom field stores the ID of a Resource's parent Course | |
*/ |
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 custom_slider_steps( $output, $params ) { | |
$output['settings']['YOUR_SLIDER_FACET_NAME']['range'] = array( | |
'min' => array( 0.001 ), | |
'25%' => array( 0.01, 0.01 ), | |
'50%' => array( 1, 1 ), | |
'75%' => array( 100, 100 ), | |
'max' => array( 250000 ) | |
); |
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( 'searchwp_swp_query_args', function( $args ) { | |
if ( isset( $args['facetwp'] ) ) { | |
$args['posts_per_page'] = -1; | |
} | |
return $args; | |
} ); |
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
/* updated 2019-02-22 */ | |
{ | |
"facets": [ | |
{ | |
"name": "test_checkboxes", | |
"label": "Test checkboxes", | |
"type": "checkboxes", | |
"source": "post_type", | |
"parent_term": "", | |
"hierarchical": "no", |
OlderNewer