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-loaded', function() { | |
var in_use = ('' != FWP.build_query_string()); | |
$('.your-reset-btn').toggleClass('hidden', ! in_use); | |
}); | |
})(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
add_filter( 'relevanssi_content_to_index', 'rlv_index_attachment_names', 10, 2 ); | |
function rlv_index_attachment_names( $content, $post_id ) { | |
if ($post_id->post_type == "your_post_type") { | |
$files = rwmb_meta( '_your_meta_file_advanced' ); | |
foreach ( $files as $file ) { | |
$content .= ' ' . $file['title']; | |
} | |
} | |
return $content; | |
} |
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-loaded', function() { | |
var facets_in_use = function() { | |
var in_use = false; | |
var checking = ["who", "what", "where", "when"]; | |
$.each(FWP.facets, function(name, val) { | |
if (0 < val.length && $.inArray( name, checking ) > -1) { | |
in_use = true; | |
return false; // exit loop | |
} |
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 custom sorting options (asc/desc) | |
*/ | |
add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' ); | |
function custom_woocommerce_get_catalog_ordering_args( $args ) { | |
$orderby_value = isset( $_GET['orderby'] ) ? wc_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); | |
if ( 'random_list' == $orderby_value ) { | |
$args['orderby'] = 'rand'; | |
$args['order'] = ''; | |
$args['meta_key'] = ''; |
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
/* | |
Omnia Base Styles | |
Version: 1.0 | |
Author: Omnia Creative Studio | |
Author URI: https://omniacreativestudio.com/ | |
*/ | |
/* -- Alignment Helpers -- */ | |
.align_left { text-align: left;} |
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
// Adapted from https://gist.github.com/mgibbs189/f2469009a7039159e229efe5a01dab23 | |
function fwp_load_more() { | |
?> | |
<script> | |
(function($) { | |
$(function() { | |
if ('object' != typeof FWP) { | |
return; | |
} |
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 | |
/** | |
* @package Smashing_plugin | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: Smashing plugin | |
Plugin URI: https://www.smashingmagazine.com/2016/03/advanced-wordpress-search-with-wp_query/ | |
Description: This is an example plugin for Smashing Magazine readers. | |
Author: Carlo Daniele |
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 user's first and last name, else just their first name, else their | |
* display name. Defalts to the current user if $user_id is not provided. | |
* | |
* @param mixed $user_id The user ID or object. Default is current user. | |
* @return string The user's name. | |
*/ | |
function km_get_users_name( $user_id = null ) { |
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
/** | |
* Filter the categories archive widget to add a span around post count | |
*/ | |
function smittenkitchen_cat_count_span( $links ) { | |
$links = str_replace( '</a> (', '</a><span class="post-count">(', $links ); | |
$links = str_replace( ')', ')</span>', $links ); | |
return $links; | |
} | |
add_filter( 'wp_list_categories', 'smittenkitchen_cat_count_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
add_action( 'pmxi_saved_post', 'post_saved', 10, 1 ); | |
function post_saved( $id ) { | |
global $wpdb; | |
$pass = get_user_meta( $id, 'xfer_user_pass', true ); | |
$table = $wpdb->prefix . 'users'; | |
$wpdb->query( $wpdb->prepare( | |
" | |
UPDATE `" . $table . "` | |
SET `user_pass` = %s |
NewerOlder