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_indexer_row_data', function( $rows, $params ) { | |
/* index the comment ratings */ | |
if ( 'comment_rating' == $params['facet']['source'] ) { | |
$post_id = (int) $params['defaults']['post_id']; | |
$comments = get_comments( [ 'post_id' => $post_id ] ); | |
foreach ( $comments as $comment ) { | |
$new_row = $params['defaults']; |
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 to your (child) theme's functions.php | |
add_action( 'wp_head', function() { | |
?> | |
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
$(document).trigger('envira_load'); |
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($) { | |
FWP.hooks.addAction('facetwp/loaded', function() { | |
var facet_name = 'search'; // EDIT ME | |
var allowed_elements = '.cat-item__title a, .cat-item__descr p'; // EDIT ME | |
var keywords = FWP.facets[facet_name].toString(); | |
if ('' !== keywords) { | |
$(allowed_elements).each(function() { | |
var results = $(this).html(); |
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 to your (child) theme's functions.php | |
add_filter( 'wp_get_attachment_image_attributes', function( $attr, $attachment ) { | |
if ( ! isset( $attr['title'] ) ) { | |
$title = get_the_title( $attachment->ID ); | |
if ( ! empty( $title ) ) { | |
$attr['title'] = $title; |
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
jQuery(document).ready(function($) { | |
//* FacetWP Isotope | |
var fwpScrollToBtn = false; | |
var $grid = $('.fwpl-layout'); | |
$grid.imagesLoaded(function() { | |
//* Wrapped in a short timeout function because $grid.imagesLoaded doesn't reliably lay out correctly | |
setTimeout(function(){ | |
$grid.isotope({ | |
itemSelector: '.fwpl-result', | |
}); |
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 the following to your (child) theme's functions.php file | |
add_action( 'wp_head', function() { | |
?> | |
<script> | |
(function($) { | |
$(function() { | |
if ('undefined' !== typeof FWP) { |
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 to your (child) theme's functions.php | |
add_action( 'wp_head', function() { | |
?> | |
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
$(document).trigger('updated_cart_totals'); // fix the "+/-" quantity buttons |
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 to your (child) theme's functions.php | |
add_filter( 'term_link', function( $termlink, $term, $taxonomy ) { | |
if ( 'portfolio_skills' == $taxonomy ) { /* TODO: this taxonomy name may need to change? */ | |
$termlink = '/wineries-2/?_wine_types=' . $term->slug; | |
} | |
return $termlink; | |
}, 10, 3); |
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 to your (child) theme's functions.php file | |
add_action( 'wp_head', function() { | |
?> | |
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
$('.facetwp-facet-product_categories > .facetwp-checkbox .facetwp-expand').each(function() { |
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 the following into your (child) theme's functions.php | |
add_action( 'wp_head', function() { | |
?> | |
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
$('.fwpl-item.titleemail a').each(function() { |