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
// Requires Touchswipe.js https://github.com/mattbryson/TouchSwipe-Jquery-Plugin | |
jQuery(document).bind('cbox_open', function(){ | |
jQuery("#colorbox").swipe( { | |
//Generic swipe handler for all directions | |
swipeLeft:function(event, direction, distance, duration, fingerCount) { | |
jQuery.colorbox.prev(); | |
}, | |
swipeRight:function(event, direction, distance, duration, fingerCount) { | |
jQuery.colorbox.next(); |
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(!function_exists('rp_modify_post_mime_types')) { | |
function rp_modify_post_mime_types($post_mime_types) { | |
$post_mime_types['application/pdf'] = array(__('PDF'), __('Manage PDF'), _n_noop('PDF <span class="count">(%s)</span>', 'PDF <span class="count">(%s)</span>')); | |
$post_mime_types['text/csv'] = array(__('CSV'), __('Manage CSV'), _n_noop('CSV <span class="count">(%s)</span>', 'CSV <span class="count">(%s)</span>')); | |
$post_mime_types['application/vnd.openxmlformats-officedocument.wordprocessingml.document'] = array(__('Word Doc'), __('Manage Word Doc'), _n_noop('Word Doc <span class="count">(%s)</span>', 'Word Doc <span class="count">(%s)</span>')); | |
$post_mime_types['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] = array(__('Excel'), __('Manage Excel'), _n_noop('Excel <span class="count">(%s)</span>', 'Excel <span class="count">(%s)</span>')); | |
$post_mime_types['application/vnd.ms-excel.sheet.macroEnabled.12'] = array(__('Excel (Macro Enabled)'), __('Manage Excel'), _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
<?php | |
/** | |
* Filters default image arguments for TSF. | |
* | |
* @param array $defaults The image defaults. | |
* @param array $args The image callback arguments. | |
*/ | |
add_filter( 'the_seo_framework_og_image_args', function( $defaults, $args = array() ) { |
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( 'gform_file_upload_markup', 'change_upload_markup', 10, 4 ); | |
function change_upload_markup( $file_upload_markup, $file_info, $form_id, $field_id ) { | |
return '<strong>' . esc_html( $file_info['uploaded_filename'] ) . "</strong > <img class='gform_delete' src='" . GFCommon::get_base_url() . "/images/delete.png' onclick='gformDeleteUploadedFile({$form_id}, {$id}, this);' />"; | |
} | |
// JS: |
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 | |
/* ========================================================================== | |
Holiday Message Hooks | |
============================================================================= */ | |
if(function_exists('holiday_messages')) { | |
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
// License: GPLv2+ | |
var el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
ServerSideRender = wp.components.ServerSideRender, | |
TextControl = wp.components.TextControl, | |
InspectorControls = wp.editor.InspectorControls; | |
/* | |
* Here's where we register the block in JavaScript. |
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
// To easily view how a site looks when CSS Grid is not available, use this in the SASS file. | |
// First you need this variable: | |
$cssgrid: "(grid-template-rows:initial)"; | |
// Then you can uncomment the below to re-declare the variable and so disable the @supports for every browser: | |
// $cssgrid: "(display:no-css-grid-support)"; | |
// Wrap every usage of CSS Grid in this: | |
@supports(#{$cssgrid}) { |
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
// Need to add "frontend" class to the site - this is to prevent this stuff happening on the WYSIWYG editor | |
html.frontend { | |
@media only screen and (min-width: 1920px) { // Correct size for large screens | |
font-size: 62.5%; | |
} | |
@media only screen and (max-width: 1289px) { // Slightly larger size for small screens | |
font-size: 0.6vw; | |
} |
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
// Include intersection-observer-polyfill.js for older browsers | |
// https://github.com/w3c/IntersectionObserver/tree/master/polyfill | |
// JS: | |
// Get scroll direction | |
var lastScrollTop = 0, delta = 5; | |
var lastScrollDirection = null; | |
$(window).scroll(function(event){ |
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
// IntersectionObserver | |
// Used with Rubious plugin and lazy load images | |
var images = document.querySelectorAll('[data-lazy-src]'); | |
var config = { | |
rootMargin: '0px 0px 400px 0px', | |
threshold: 0 }; | |
var loaded = 0; |
OlderNewer