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
jQuery(document).ready(function(){ | |
/** | |
* Add class of ll to each favicon link you want to lazy load | |
* Also change the href to data-href and the below script will do the rest | |
* | |
* @type {*|jQuery|HTMLElement} | |
*/ | |
var links = $('link.ll'); | |
links.each(function() { |
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 to check weather or not an image sizes exists in the thumbnail library for a specific attachment id | |
* | |
* @param $attachment_id - the id of any image in the se | |
* @param $image_size_name - the name from add_image_size() | |
* | |
* @return bool | |
*/ | |
function check_image_size( $attachment_id, $image_size_name ){ |
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
/** | |
* Save Form Items to ACF Properly | |
* | |
* | |
*/ | |
function und2_form_resubmit_fields($entry, $form){ | |
$args = array( | |
'post_type' =>'CUSTOM_POST_TYPE', | |
'posts_per_page' => 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
<?php | |
/** | |
* Search | |
*/ | |
class Search { | |
public $postcode; | |
public $transient_name; | |
public $location; |
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 echo $adults ?> live in a <?php echo ($bedrooms==1?$bedrooms . ' bedroom': $bedrooms . ' bedrooms') ?> <?php echo $home_type ?> in <?php echo $town ?>. | |
<?php if($children!=0): ?> | |
They live with <?php echo $children ?> children in the home. | |
Their | |
<?php if($child_1_gender != 'N/a' && $child_1_gender != 'None'): ?> | |
<?php echo $child_1_gender ?> was born in <?php echo $child_1_dob ?> | |
<?php endif; ?> | |
<?php if($child_2_gender != 'N/a' && $child_2_gender != 'None'): ?> |
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 | |
/** | |
* Bootstrap Alert Dialog | |
* | |
* @link http://v4-alpha.getbootstrap.com/components/alerts/ | |
* | |
* @param $a array containing the options for this function. Expected array keys are below | |
* html - string - this is the HTML that will be outputted | |
* type - string - type of alert info(default), success, warning, danger | |
* close_button - bool- true or false to display |
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 throttle(f, delay){ | |
var timer = null; | |
return function(){ | |
var context = this, args = arguments; | |
clearTimeout(timer); | |
timer = window.setTimeout(function(){ | |
f.apply(context, args); | |
}, | |
delay || 500); | |
}; |
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
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |