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
// floor with precision function | |
@function decimal_floor( $val , $precision: 2 ) { | |
$n: 1; | |
@for $d from 1 through $precision { | |
$n: $n * 10; | |
} | |
@return floor($val * $n) / $n; | |
} |
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
// strip unit from passed value | |
@function strip_unit($val) { | |
@return $val / ($val * 0 + 1); | |
} |
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
$count_stickies = count(get_option( 'sticky_posts' )); | |
$ppp = 6; | |
$offset = ( $count_stickies <= $ppp ) ? ( $ppp - ( $ppp - $count_stickies ) ) : $ppp; | |
$args = array( | |
'posts_per_page' => $ppp - $offset | |
); | |
$loop = new WP_Query( $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
// WOOCOMMERCE show sku for bundled products | |
add_action( 'woocommerce_bundled_item_details', 'show_bundled_sku', 16 ); | |
function show_bundled_sku( $bundled_item, $product ) { | |
if ($bundled_item->product->sku) { | |
printf('<p class="sku"><span class="woocommerce-Sku sku">%s</span></p>',$bundled_item->product->sku) ; | |
} | |
} |
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
// --------- Max Dissolved Oxigen Saturation ------------// | |
// | |
// Equation for the Henry coefficient as a function of temperature and salinity is used to calculate values | |
// for unit standard atmospheric concentrations (USAC) in freshwater and seawater in equilibrium with air at a total pressure | |
// of 1 atmosphere. It is estimated that the possible error in the new USAC values is no greater than $\pm 0.1%$ and probably less. | |
// Tables and equations are presented for obtaining accurate USAC values in the ranges $0^\circ < t < 40^\cir C and 0 < S < 40$. | |
// Simple procedures are given for calculating standard atmospheric concentrations at pressures different from 1 atm. | |
// | |
// Reference https://water.usgs.gov/software/DOTABLES/ | |
// Dissolved oxygen (DO) solubility over a range of user-specified values for |
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
if ($('.wp-block-gallery')) { | |
$('.blocks-gallery-item').click(function() { | |
var galleryImages = $(this).closest('.wp-block-gallery').find('a'); | |
var gallery = []; | |
galleryImages.each(function( index, galleryItem ) { | |
var caption = $(this).parent().find('figcaption') ? $(this).find('img').attr('alt') : $(this).parent().find('figcaption') ; |
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
ul.product-categories ul { | |
margin: 0; | |
padding-left: 32px | |
} | |
ul.product-categories li { | |
line-height: 42px; | |
margin: 0 | |
} |
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
$gutter_size: 3%; | |
$number_of_columns: 3; | |
$total_gutter_space: ( $number_of_columns - 1 ) * $gutter_size; | |
.grid__item, | |
.grid__col-sizer { | |
width: calc( ( 100% - #{$total_gutter_space} ) / #{$number_of_columns} ); | |
} | |
.grid__gutter-sizer { |
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('wp_generate_attachment_metadata', 'custom_crop'); | |
function custom_crop($metadata) { | |
$square_image_size = 320; | |
$uploads = wp_upload_dir(); | |
$file = path_join( $uploads['basedir'], $metadata['file'] ); // original image file |
OlderNewer