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 | |
/* | |
* Facet name: beds | |
* Facet type: dropdown | |
* Data source: "min_beds" | |
* | |
* This hook will index all values between min_beds and max_beds. If min_beds = 2 and max_beds = 5, | |
* then the values "2", "3", "4" and "5" will get indexed for this post. | |
*/ |
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_facet_filter_posts', function( $result, $params ) { | |
if ( 'categories' == $params['facet']['name'] ) { | |
return 'continue'; // prevent this facet from being processed | |
} | |
return $result; | |
}, 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( 'wp_head', function() { | |
?> | |
<script> | |
(function($) { | |
$(function() { | |
if ('object' != typeof FWP) return; |
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 ( $query->is_post_type_archive( 'resource' ) ) { | |
$query->set( 'orderby', 'title' ); | |
$query->set( 'order', 'ASC' ); | |
} | |
}); |
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 ( 2 === (int) $query->get( 'posts_per_page' ) ) { | |
$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
.facetwp-type-checkboxes .facetwp-checkbox { | |
background-position-x: 100%; | |
padding: 0 20px 0 0; | |
} |
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 | |
// replace "YOUR_FACET_NAME" with your *actual* facet name | |
add_filter( 'facetwp_render_output', function( $output ) { | |
$output['settings']['YOUR_FACET_NAME']['locale'] = [ | |
'weekdays_short' => ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'], | |
'months_short' => ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'], | |
'months' => ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'], |
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( 'post_link', function( $url, $post ) { | |
if ( 'upt_user' == get_post_type( $post->ID ) ) { | |
$user_id = UPT()->get_user_id( $post->ID ); | |
$url = get_author_posts_url( $user_id ); | |
} | |
return $url; |
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-loaded', function() { | |
var $grid = $('.columns-3').imagesLoaded(function() { | |
$grid.isotope({ | |
layoutMode: 'masonry', | |
itemSelector : '.product', | |
masonry: { | |
columnWidth: '.product', |
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_map_init_args', function( $settings ) { | |
for ( $i = 1; $i <= 5; $i++ ) { | |
$settings['config']['cluster']['styles'][] = [ | |
'url' => FACETWP_MAP_URL . '/assets/img/m' . $i . '.png', | |
'width' => 53, | |
'height' => 53, |
NewerOlder