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 | |
// remove decimals (change) from Gravity Form's USD currency input | |
// reference: https://organicweb.com.au/wordpress/gravity-forms-price-rounding/ | |
// useful info: https://docs.gravityforms.com/gform_currencies/ | |
add_filter( 'gform_currencies', 'update_currency' ); | |
function update_currency( $currencies ) { | |
$currencies['USD'] = array( | |
'name' => __( 'U.S. Dollar', 'gravityforms' ), | |
'symbol_left' => '$', |
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 | |
// https://wordpress.org/support/topic/vimeo-oembed-now-has-dnt1-parameter/ | |
// replace the dnt=1 parameter that WordPress adds to the Vimeo player when using oEmbed | |
function dl_oembed ( $provider, $url, $args ) { | |
if ( strpos( $provider, 'vimeo.com' ) !== false) | |
return add_query_arg( array('dnt' => false), $provider ); | |
} | |
add_filter( 'oembed_fetch_url', 'dl_oembed', 10, 3 ); |
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 add_id_to_html_element( $output ) { | |
global $post; | |
$output .= ' id="custom-id-' . $post->ID . '"'; | |
return $output; | |
} | |
add_filter( 'language_attributes', 'add_id_to_html_element' ); |
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 | |
// ACF Relationship Shortcode | |
function shortcode_acf_relationship_news( $atts ) { | |
// begin output buffering | |
ob_start(); | |
// variable to check if it has any News posts chosen | |
$news_post_variable = get_field('news'); |
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 | |
// use examples: [nextdaytime day="+1 day"] [nextdaytime day="+2 day"] | |
function displaynextdaytime($atts){ | |
$originalZone = date_default_timezone_get(); //save timezone | |
date_default_timezone_set(get_option('timezone_string')); //set it to your admin value | |
$time = strtotime($atts['day']); //time for the date() function based on our 'day' attribute | |
if (date('l', $time) == 'Sunday'){ | |
$statusStr = 'Open'; | |
$timeStr = 'Noon – 5PM'; | |
} |
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 Tracking Code to the Order Recieved Page | |
*/ | |
function wc_ninja_checkout_analytics( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$currency = $order->get_order_currency(); | |
$total = $order->get_total(); | |
$date = $order->order_date; | |
?> | |
<!-- Paste Tracking Code Under Here --> |
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
jQuery(function($) { | |
window.et_pb_smooth_scroll = function($target, $top_section, speed, easing) { | |
var $window_width = $(window).width(); | |
$menu_offset = -1; | |
var headerHeight = 143; | |
if ($('#wpadminbar').length && $window_width <= 980) { |
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
// https://wordpress.org/support/topic/vimeo-oembed-now-has-dnt1-parameter/ | |
// replace the dnt=1 parameter that WordPress adds to the Vimeo player when using oEmbed | |
jQuery(document).ready(function($){ | |
// find any Vimeo iframe | |
$('iframe[src*="player.vimeo.com"]').each(function(){ | |
// get the src | |
var src = $(this).attr('src'); | |
// replace parameter with nothing | |
$(this).attr('src',src.replace('dnt=1&', '')); | |
}); |
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 fs_sc_author_byline( $atts ){ | |
// begin output buffering | |
ob_start(); | |
global $post; // if outside the loop | |
$byline = get_field('show_author'); | |
if ( isset($byline) && $byline == '1') { |