This file contains hidden or 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 ff_get_terms_by_post_type( $taxonomies, $args=array() ){ | |
$args = wp_parse_args($args); | |
if( !empty($args['post_types']) ){ | |
$args['post_types'] = (array) $args['post_types']; | |
add_filter( 'terms_clauses', 'ff_get_terms_by_post_type_filter',10,3); | |
} | |
return get_terms($taxonomies, $args); | |
} | |
function ff_get_terms_by_post_type_filter($pieces, $tax, $args) { | |
global $wpdb; |
This file contains hidden or 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 ff_check_more_posts($args){ | |
$args['showpost'] = 1; | |
$q = new WP_Query($args); | |
if( $q->have_posts() ) { | |
return true; | |
} | |
return false; | |
} |
This file contains hidden or 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
/*! FF Equal Heights Plugin */ | |
$.fn.ff_equal_heights = function( options ) { | |
if( !$(this).length ) return; | |
var $this = this; | |
var settings = $.extend({ | |
enable_on_resize: true, | |
disable_on_width: false, |
This file contains hidden or 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
/*! FF Swap Children Plugin */ | |
$.fn.ff_swap_children = function( options ) { | |
if( !$(this).length ) return; | |
var $this = this; | |
var settings = $.extend({ | |
window_width: 768 | |
}, options ); |
This file contains hidden or 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 ff_get_user_location(){ | |
// Get user ip | |
if( isset($_SERVER['HTTP_CF_CONNECTING_IP']) ) { | |
$user_ip = $_SERVER['HTTP_CF_CONNECTING_IP']; | |
} else { | |
if( isset($_SERVER['REMOTE_ADDR']) ) { | |
$user_ip = $_SERVER['REMOTE_ADDR']; | |
} | |
} |
This file contains hidden or 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
<style> | |
div { | |
overflow: hidden; | |
position: relative; | |
} | |
div:before { | |
content: ""; | |
position: absolute; | |
bottom: -100px; | |
left: 50%; |
This file contains hidden or 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
// Logo Markup | |
add_filter('genesis_seo_title', 'ff_seo_title', 10, 3); | |
function ff_seo_title($title, $inside, $wrap) { | |
// Get Logo | |
$site_logo = get_field('site_logo', 'option'); | |
$default_logo_url = get_stylesheet_directory_uri() . '/images/logo.png'; | |
$size_attributes = ' width="'. $site_logo['width'] .'" height="'. $site_logo['height'] .'"'; | |
// Set Logo | |
$logo_url = ( $site_logo ) ? $site_logo['url'] : $default_logo_url; | |
return buffer_action('fbf_before_site_logo') . apply_filters('fbf_site_logo', '<a href="'. home_url() .'" title="'. get_bloginfo('title') .'"><img id="site_logo_image" '. $size_attributes .' src="'. $logo_url .'" alt="'. get_bloginfo('title') .' Logo" data-rjs="2"/></a>') . buffer_action('fbf_after_site_logo'); |
This file contains hidden or 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 to cart markup - added custom input field for event_id | |
$price = get_post_meta(get_the_ID(), 'price', true ); | |
if( $price ) { | |
echo '<form class="cart" action="" method="post" enctype="multipart/form-data"> | |
<div class="quantity"> | |
<label class="screen-reader-text" for="quantity_5beeab967f651">Quantity</label> | |
<input type="number" id="quantity_5beeab967f651" class="input-text qty text" step="1" min="1" max="" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" aria-labelledby=""> | |
</div> | |
<input type="hidden" name="event_id" value="'. get_the_ID() .'"> | |
<button type="submit" name="add-to-cart" value="119" class="single_add_to_cart_button button alt">Add to cart</button> |
This file contains hidden or 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('woocommerce_package_rates','ff_override_shipping_rate',100,2); | |
function ff_override_shipping_rate($rates, $package) { | |
// Get total products quantity on the cart | |
$total_product_quantity = 0; | |
foreach( $package['contents'] as $cart_line ) { | |
$total_product_quantity += $cart_line['quantity']; | |
} | |
// If quantity is more than 5, set cost to 10 | |
if( $total_product_quantity > 5 ) { | |
foreach ($rates as $rate) { |
This file contains hidden or 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
var i = 0; | |
var load_more_scroll_listener; | |
function begin_scroll_checker(data) { | |
load_more_scroll_listener = scroll_check(data); | |
window.addEventListener('scroll', load_more_scroll_listener); | |
} | |
begin_scroll_checker(); | |
function scroll_check(data) { | |
return function scroll_event(event) { | |
i++; |