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_query_args', function( $query_args, $class ) { | |
if ( 0 < count( $class->facets['distance']['selected_values'] ) ) { | |
$query_args['orderby'] = 'post__in'; | |
$query_args['order'] = 'ASC'; | |
} | |
return $query_args; | |
}, 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
<?php | |
$args = array( | |
'post_type' => 'location', | |
'posts_per_page' => -1, | |
'order' => 'ASC', | |
'orderby' => 'title', | |
'facetwp' => true, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'advertiser-level', |
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 child themes functions.php file | |
add_filter( 'facetwp_map_init_args', function ( $args ) { | |
$args['scrollwheel'] = false; | |
return $args; | |
} ); |
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 /* Template Name: Full Map Facet Search */ ?> | |
<?php include('content/map-header.php'); // special header for map search page ?> | |
<div id="#map-page-content-container"> | |
<button id="map-trigger">Search Map</button> | |
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 | |
/** | |
* Ignore WooCommerce Membership product restrictions when facets are used on Shop page. | |
* | |
* @uses FacetWP | |
* @uses WooCommerce Memberships | |
*/ | |
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
if ( 'wc_user_membership' == $query->get( 'post_type' ) ) { |
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
<script> | |
(function($) { | |
$(document).on('facetwp-refresh', function() { | |
if (FWP.loaded) { // after the initial pageload | |
FWP.parse_facets(); // load the values | |
FWP.set_hash(); // set the new URL | |
location.reload(); | |
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
<?php | |
remove_action( 'genesis_loop', 'genesis_do_loop'); | |
add_action( 'genesis_loop', 'lofts_floor_plan_loop' ); | |
//* Add filtering sidebar | |
add_action( 'genesis_before_content', 'floorplan_filters' ); | |
function floorplan_filters() { |
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 | |
function touteslesbox_fwp_archive_query( $query ) { | |
if ( is_admin() || ! $query->is_main_query() ) | |
return $query; | |
remove_filter('pre_get_posts', 'touteslesbox_fwp_archive_query', 1); | |
if ( $query->is_post_type_archive( 'coupons' ) ) { |
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
<div id="home-posts" class="container"> | |
<h3 style="margin-top: 40px; margin-bottom: 40px;"><?php wp_title(); ?></h3> | |
<?php if ( have_posts() ) : ?> | |
<div class="facetwp-template"> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<div class="archive-item"> | |