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 | |
// Default grid render settings | |
$grid_settings = array( | |
"first" => 'first_row', // Classname for first row | |
"last" => 'last_row', // Classname for last row | |
"single" => 'single', // Classname for single row (grid with only 1 row) | |
"column_first" => 'first_col', // Classname for first column | |
"column_last" => 'last_col', // Classname for last column | |
"column_single" => 'single', // Classname for single column (grid row with a single column) |
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
$.fn.formJSON = function(){ | |
var fields = $(this).serializeArray(), | |
json = {}, | |
arraynames = {}; | |
for( var v = 0; v < fields.length; v++){ | |
var field = fields[v], | |
name = field.name.replace(/\]/gi,'').split('['), | |
value = field.value, | |
lineconf = {}; | |
for(var i = name.length-1; i >= 0; i--){ |
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
/* Attrify | |
Allows you to activate and configure jQuery plugins* via html attributes & without writing javascript. | |
* most, not all. | |
EXAMPLE: | |
<a class="attrify" | |
data-plugn="nivoLightbox" | |
data-effect="fade" | |
data-theme="default" |
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 re_init_wp_editors(){ | |
if( typeof tinyMCEPreInit === 'undefined'){ | |
return; | |
} | |
var ed, init, edId, qtId, firstInit, wrapper; | |
if ( typeof tinymce !== 'undefined' ) { |
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 this to your theme or child theme's functions.php file to | |
// remove the cf_id=x from redirect URLs on form submit | |
function cf_remove_cfid( $url ){ | |
if( false !== strpos( $url, '?' ) ){ | |
$parts = explode( '?', $url ); | |
parse_str( $parts[1], $query ); | |
if( isset( $query['cf_id'] ) ){ | |
unset( $query['cf_id'] ); | |
return $parts[0] . '?' . http_build_query( $query ); |
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 | |
/** | |
* The Template for displaying product archives, including the main shop page which is a post type archive | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
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 my_facetwp_facet_html( $output, $params ) { | |
if ( 'monthly_tags' == $params['facet']['name'] ) { | |
$output = ' | |
<div class="facetwp-checkbox" data-value="january-2017"> | |
January 2017 | |
<span class="facetwp-counter">(1)</span> | |
</div> | |
<div class="facetwp-checkbox" data-value="february-2017"> | |
February 2017 | |
<span class="facetwp-counter">(1)</span> |
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 my_facetwp_index_row( $params, $class ) { | |
if ( 'branch' == $params['facet_name'] ) { | |
$values = (array) $params['facet_value']; // an array of post IDs (it's already unserialized) | |
foreach ( $values as $val ) { | |
$params['facet_value'] = the_field( 'martygeocoderlatlng', $val ); | |
$params['facet_display_value'] = the_field('martygeocoderaddress', $val); | |
$class->insert( $params ); // insert each value to the database | |
} | |
// skip the default indexing query | |
return 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
(function($) { | |
$(document).on('facetwp-refresh', function() { | |
if( FWP.extras['sort'] !== 'default' ){ | |
return; | |
} | |
if ( FWP.facets['baby_sitter_cost'].length ) { | |
FWP.extras['sort'] = 'cost'; | |
}else if ( FWP.facets['age'].length ) { | |
FWP.extras['sort'] = 'age'; | |
}else if ( FWP.facets['experience'].length ) { |
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 cspm_display_single_product_map(){ | |
echo do_shortcode('[facetwp map="true"]'); | |
} | |
add_action('woocommerce_after_single_product_summary', 'cspm_display_single_product_map', 15); |
OlderNewer