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 to your (child) theme's functions.php, or into the Custom Hooks plugin! | |
add_action( 'wp_head', function() { | |
?> | |
<script> | |
(function($) { | |
FWP.hooks.addFilter('facetwp/flyout/facets', function(facets) { |
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_builder_item_value', function( $value, $item ) { | |
if ( 'el-2ydbgp' == $item['settings']['name'] ) { | |
$value = do_shortcode( $value ); | |
} | |
return $value; | |
}, 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
# How to install a new WordPress site from scratch using WP-CLI. | |
# We are going to assume that you have installed WP-CLI with all of the needed dependencies (composer, mysql, php) and added them to the global system/user path. | |
# Commands that you need to use in the CLI are marked with a ">" at the start of the row (you don't need to add that to the command). | |
# Create a new empty directory in your /www path. You can do that from the CLI directly. We are going to do a local install using WAMP software stack. | |
# Either go to the /www directory through explorer and create a new folder or use the following command in the CLI (you have to change your current directory to '/wamp/www' first). | |
> mkdir wordpress |
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 | |
/** adds script to header with a conditional check to not scroll to top | |
** when the load more button has been clicked | |
**/ | |
add_action( 'wp_head', function() { ?> | |
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
if (FWP.loaded && 'undefined' === typeof FWP_JSON.load_more) { |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2015 Larry Fox <http://larryfox.us> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
/** | |
* Set {n} selected text to show after 1 selection, on all facets | |
*/ | |
function td_facetwp_selected() { | |
if ( is_tax() ) { | |
?> | |
<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
add_filter( 'facetwp_render_output', function( $output ) { | |
$output['settings']['location']['numDisplayed'] = 1; | |
return $output; | |
}); |
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 | |
/* | |
/* | |
Plugin Name: Download member report as csv | |
Plugin URI: http:// | |
Description: This plugin is called when the 'download csv' button is clicked on the Member Reports page containing FacetWP search | |
Version: 1.0 | |
Author: [email protected] | |
Author URI: http://www.greenbee-web.com/ | |
License: GPL2 |
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('click', '#reset', function() { | |
FWP.is_reset = true; | |
FWP.facets['my_facet'] = []; // set facet to no selections | |
delete FWP.facets['paged']; // remove "paged" from URL | |
FWP.refresh(); | |
}); | |
})(jQuery); |
NewerOlder