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
/*** | |
* Gravity Forms: Validate to ensure date fields are not the same or todays date | |
* | |
* This will validate the fields on form submission and return a validation error on the fields in question. | |
* In this case it validates an Arrival and Departure date against each other and today's date. | |
* | |
* Code goes in your theme's functions.php file. | |
***/ | |
add_filter('gform_field_validation','validate_dates',10,4); |
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
function revealPartialSlide(padding) { // Padding (amount of the next slide you want to reveal) | |
var $slides = $('.element').find('.slick-slide') // Find the slides | |
,slideCount = $slides.length // Grab the amount of slides | |
,slidesToShow = $('.element').slick('getOption','slidesToShow') // Grab the 'slidesToShow' number | |
,slideWidth = $slides.outerWidth() // Get the width of the slides (as calculated by Slick) | |
,newWidth = Math.round(slideWidth - (padding / slidesToShow)) // Calculate the new width | |
// If less slides than you want to show, do nothing.... | |
if(slideCount < slidesToShow) { | |
return false; |
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
<? | |
/*** | |
* | |
* Goes into your themes functions.php | |
* TODO: Create Plugin | |
* | |
***/ | |
function add_country_codes() { | |
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 | |
/** | |
* Output Responsive Image Tag based on ACF Image Field | |
* | |
* @param $image (array) ACF Image Field | |
* @param $size (string) Image size name (ie. medium, large, my-custom-image-size ) | |
* @param $lazyload (bool) Enable/Disable lazy loading of responsive images (requires lazysizes.js to be loaded — see https://github.com/aFarkas/lazysizes) | |
* @param $classes (array) Array of class names to apply to the image | |
* @author Eivind Borgersen for Hyphen |
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 | |
/** | |
Usage: | |
require( TEMPLATEPATH . '/includes/Int_String.php' ); | |
$intstr = new IntString; |