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 | |
function acf_set_featured_image( $value, $post_id, $field ){ | |
if($value != '' && 'location' == get_post_type()){ | |
//Add the value which is the image ID to the _thumbnail_id meta data for the current post | |
update_post_meta($post_id, '_thumbnail_id', $value); | |
} | |
return $value; |
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 | |
/* Need to include flipclock.js's css and js files. Instructions found on their github page | |
* http://flipclockjs.com | |
* | |
*/ | |
// Flipper countdown function | |
function sls_flipper_countdown($atts){ | |
// Attributes - For the End Date | |
extract( shortcode_atts( | |
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
<script> | |
/* | |
* This simple script will take multiple html elements, like a group of <li> or <span> or anything, | |
* and reorder them by the data attribute. | |
* Example: | |
* The script will reorder this: | |
* <span data-test="1">Number 1</span> | |
* <span data-test="4">Number 2</span> | |
* <span data-test="3">Number 3</span> | |
* <span data-test="2">Number 4</span> |
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_shortcode( 'video-testimonials', 'sls_video_testimonial_short_code' ); | |
function sls_video_testimonial_short_code( $atts ) { | |
ob_start(); | |
$query = new WP_Query( array( | |
'post_type' => 'video-testimonial', | |
'posts_per_page' => 4, | |
'order' => 'ASC', | |
'orderby' => 'title', |
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
# Trigger button/link | |
# Must use the 'onClick' method to target the modal, rather than 'data-target' | |
<a href="javascript:void(0);" id="login-pop-trigger" onClick="jQuery(\'#login-popup\').modal();" role="button" data-toggle="modal"><i class="fas fa-user-plus" aria-hidden="true"></i> Login</a> | |
# Simple Modal | |
<div id="login-popup" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;"> | |
<div class="modal-body"> | |
<p>You are about to delete this Page, this is irreversible.</p> | |
</div> | |
</div> |
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(){ | |
//jQuery('#rs-fullwidth-helper1').before('<p style="color:black;">testing4</p>'); | |
function countUp() { | |
jQuery('.counter').each(function() { | |
var counter = jQuery(this), | |
countTo = counter.attr("data-count"); | |
jQuery({ countNum: counter.text()}).animate({ | |
countNum: countTo |
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
<script type="text/javascript"> <!-- remove script tag if putting in html --> | |
jQuery(document).ready(function(){ | |
if(window.location.hash != "") { | |
// Clicks the tab link so that it is the active one | |
jQuery('a[href="' + window.location.hash + '"]').click(); | |
// Animate scroll to the tab | |
jQuery('html, body').animate({scrollTop: window.location.hash.offset().top -100 }, 'slow'); | |
} |
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 Docs: | |
* http://getbootstrap.com/javascript/#modals | |
* Lots of options could be added as attributes in the shortcode. The attached code is just the pieces I needed at the time. | |
* This is the simple shortcode: | |
* [sls-modal id="modal-1" header_text="HEADER TITLE HERE"] | |
* CONTENT HERE | |
* [/sls-modal] | |
* One thing that should be changed, is to allow for other respondo shortcode to be used within the content part. | |
* I hadn't shorted that out yet. |
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
var $findit = jQuery('#visualisation'); // element that needs to be in view for thing to happen | |
function Scrolledit() { | |
$findit.each(function() { | |
var $section = jQuery(this), | |
finditOffset = $section.offset(), | |
finditTop = finditOffset.top, | |
finditBottom = $section.height() + finditTop, | |
scrollTop = jQuery(document).scrollTop(), | |
visibleBottom = window.innerHeight, |