Skip to content

Instantly share code, notes, and snippets.

View webtrainingwheels's full-sized avatar

Lucy Beer webtrainingwheels

View GitHub Profile
@webtrainingwheels
webtrainingwheels / gist:f7d3541c1b79d0a1716e
Last active September 7, 2015 16:12
function to calculate age
<?php
function how_old_am_i($todaydate, $mybday) {
//convert given dates to timestamps
$currenttimestamp = strtotime($todaydate);
$bdaytimestamp = strtotime($mybday);
//get just the years from the timestamps
$currentyear = date("Y",$currenttimestamp);
$mybd = date ("Y",$bdaytimestamp);
@webtrainingwheels
webtrainingwheels / WCSD 2016 - CSS
Last active April 20, 2016 07:07
WCSD 2016 - CSS
.site-title {
font-size: 3.75rem;
}
.site-branding .site-title a {
color: #FF0000;
}
.site-branding {
margin-top: 0px;
register_sidebar( array(
'name' => 'Footer Widget',
'id' => 'footer-widget',
'before_widget' => '<div class="footer-widget">',
'after_widget' => '</div>'
) );
add_action( 'twentysixteen_credits', 'wtw_custom_footer_widget' );
@webtrainingwheels
webtrainingwheels / clear-preload-page.php
Created July 16, 2019 16:20
Clear and preload a specific page
<?php
// Load WordPress.
require( 'wp-load.php' );
// Clear specific page cache
if ( function_exists( 'rocket_clean_post' ) ) {
rocket_clean_post('30');
}
// Preload page
This file has been truncated, but you can view the full file.
/**
* @license
* Video.js 7.4.1 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/master/LICENSE>
*
* Includes vtt.js <https://github.com/mozilla/vtt.js>
* Available under Apache License Version 2.0
* <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
This file has been truncated, but you can view the full file.
/**
* @license
* Video.js 7.4.1 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/master/LICENSE>
*
* Includes vtt.js <https://github.com/mozilla/vtt.js>
* Available under Apache License Version 2.0
* <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
<?php
//Disables HTML minification on product category archive pages
add_filter( 'pre_get_rocket_option_minify_html', function() {
if (is_product_category()){
return 0;
}
return null;
@webtrainingwheels
webtrainingwheels / .htaccess
Created October 30, 2019 23:39
WP Rocket htaccess rules
# BEGIN WP Rocket v3.4.0.5
# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset UTF-8
# Force UTF-8 for a number of file formats
<IfModule mod_mime.c>
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml
</IfModule>
# FileETag None is not enough for every server.
<IfModule mod_headers.c>
Header unset ETag