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 you first need to install the free plugin Simple History | |
* https://wordpress.org/plugins/simple-history/ | |
*/ | |
// pre_http_request is fired close before the actual request | |
add_filter( 'pre_http_request', function( $retval, $r, $url ) { |
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 | |
return array( | |
"post_type" => "property", | |
"post_status" => "publish", | |
"orderby" => "meta_value_num", | |
"meta_key" => "price_no_formatting", | |
"order" => "DESC", | |
"posts_per_page" => 20 | |
); |
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_index_row', 'wwce_facetwp_index_row' ); | |
function wwce_facetwp_index_row( $params ) { | |
if ( 'genre' == $params['facet_name'] || 'instruments' == $params['facet_name'] || 'mood' == $params['facet_name'] ) { | |
$values = (array) $params['facet_value']; | |
foreach ( $values as $val ) { | |
$params['facet_value'] = $val; | |
$params['facet_display_value'] = $val; |
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 | |
return array( | |
"post_type" => array( | |
"cpt1", | |
"cpt2" | |
), | |
'posts_per_page' => 28, | |
'orderby' => 'rand', | |
); | |
?> |
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 get_header(); ?> | |
<main id="main" class="body__content main" role="main"> | |
<div class="content__main"> | |
<div class="content__adv-search"> | |
<h3 class="content__adv-search--title">Refine Your Search</h3> | |
<?php //echo do_shortcode( '[facetwp facet="advanced_search"]' );?> | |
<p class="content__adv-search--subtitle">Show me only results from:</p> | |
<?php //echo do_shortcode( '[facetwp facet="refine_results"]' );?> | |
</div> | |
<header class="page__header"> |
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 my_facetwp_index_row( $params, $class ) { | |
if ( 'keydate' == $params['facet_name'] ) { // 20170823 | |
$val = $params['facet_value']; | |
$fixed = substr( $val, 0, 4 ) . '-' . substr( $val, 4, 2 ) . '-' . substr( $val, 6, 2 ); | |
$params['facet_value'] = $fixed; | |
$params['facet_display_value'] = $fixed; | |
} | |
return $params; |
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 lh_fwp_index_coming_soon_facet( $return, $params ) { | |
$facet_params = $params['defaults']; | |
if ( 'cf/edd_coming_soon' == $facet_params['facet_source'] ) { | |
$value = get_post_meta( $facet_params['post_id'], 'edd_coming_soon', true ); | |
$value = empty( $value ) ? 'Available' : 'Coming Soon'; | |
$facet_params['facet_value'] = $value; | |
$facet_params['facet_display_value'] = $value; | |
FWP()->indexer->index_row( $facet_params ); |
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 class="category-navigation"> | |
<div class="container vpadding--top vpadding--xs"> | |
<div class="row"> | |
<div class="col-xs-12"> | |
<?php echo facetwp_display( 'facet', 'adaptation_levels' ); ?> | |
<?php echo facetwp_display( 'facet', 'search' ); ?> | |
</div> | |
</div> |
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"> | |
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' ) ) { |
OlderNewer