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
<?php | |
// open the FacetWP Template wrapper | |
function be_open_facetwp_template_wrapper() { | |
echo '<div class="facetwp-template">'; | |
} | |
add_action( 'genesis_before_loop', 'be_open_facetwp_template_wrapper', 9999 ); | |
// close the FacetWP Template wrapper |
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: Get Remote Image to Custom Field | |
*/ | |
add_filter('really_simple_csv_importer_post_saved', function($post) | |
{ | |
if (is_object($post)) { | |
// Get the meta data of which key is "image" | |
$image = $post->image; |
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 | |
// When using SearchWP it's necessary to disable WooCommerce's insistance on | |
// automatically redirecting to a single search result without showing the | |
// search results page, when that happens this hook doesn't run! | |
// Willing to bet this can be edited to accommodate, tips are welcome! | |
add_filter( 'woocommerce_redirect_single_search_result', '__return_false' ); | |
function my_maybe_woocommerce_variation_permalink( $permalink ) { | |
if ( ! is_search() ) { |
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: Translation Updates Table | |
* | |
* @author Pascal Birchler <pascal@required.ch> | |
* @license GPL2+ | |
*/ | |
/** | |
* Displays a table with available translation updates. |
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 | |
/** to use this make sure all queries to be used | |
** for facets have 'facetwp' => true in query args, including the | |
** query args setting in a facetwp template | |
**/ | |
// add 'facetwp' => false anytime it is not already set | |
add_action( 'pre_get_posts', function( $query ) { | |
if ( ! isset( $query->query_var['facetwp'] ) ) { | |
$query->set( 'facetwp', false ); |
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_filtered_post_ids', 'car_zero_priced_last', 10, 2); | |
function car_zero_priced_last( $post_ids, $class ) { | |
if (!isset($class->ajax_params['http_params']['get']['fwp_sort'])) { | |
return $post_ids; | |
} | |
if (isset($class->ajax_params['http_params']['get']['fwp_sort']) && $class->ajax_params['http_params']['get']['fwp_sort'] != 'price_asc') { | |
return $post_ids; |
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 filter product queries */ | |
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
if ( 'product_query' != $query->get( 'wc_query' ) ) { | |
$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
<link href="path/to/fSelect.css" rel="stylesheet" type="text/css"> | |
<script src="path/to/fSelect.js"> | |
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
$('.facetwp-sort-select').fSelect(); | |
}); | |
})(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 | |
/** | |
* To access the data within the "Query Arguments" box, use: | |
* $this->http_params['choose_city'] | |
*/ | |
add_action( 'wp_footer', function() { | |
$choose_city = get_field( 'choose_city' ); | |
?> |
OlderNewer