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 psc_image_editor_output_format( $formats ) { | |
$formats['image/png'] = 'image/webp'; | |
return $formats; | |
} | |
add_filter( 'image_editor_output_format', 'psc_image_editor_output_format' ); |
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
//HTML | |
<div class = "scrollToTopBtn"><img src="<?php echo get_stylesheet_directory_uri() . '/img/chevron.svg'; ?>" alt="jump to top of page">TOP</div><!-- #jumpScroll --> | |
//JS | |
var scrollToTopBtn = document.querySelector(".scrollToTopBtn") | |
var rootElement = document.documentElement | |
function handleScroll() { | |
// Do something on scroll | |
var scrollTotal = rootElement.scrollHeight - rootElement.clientHeight |
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
Add an offset to the main query on the blog posts page | |
function psc_exclude_latest_post( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$query->set( 'offset', '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
body, html { | |
overflow-x: hidden; | |
} | |
.breakout { | |
margin:0 -100%; /* old browsers fallback */ | |
margin:0 calc(50% - 50vw); | |
} |
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 ($('#fastStartSolutions').length > 0) { | |
if ( $(window).width() > 991 ) { | |
var offset = $('#page .container').offset(); | |
var gutter = ( Math.ceil(offset.left) + 15 ); | |
$('.video-left .video-wrapper').css('left', '-' + (gutter - 30) + 'px'); | |
} | |
} |
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
<div id="mc_embed_signup"> | |
<form action="#" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank"> | |
<div id="mc_embed_signup_scroll" class = "d-flex"> | |
<div class="mc-field-group"> | |
<label for="mce-EMAIL" class = "sr-only">Email Address </label> | |
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder = "Email Address"> | |
</div><!-- .mc-field-group --> | |
<div id="mce-responses" class="clear"> | |
<div class="response" id="mce-error-response" style="display:none"></div> | |
<div class="response" id="mce-success-response" style="display:none"></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
//Add 'has-selection' class to select dropdown on click | |
$('form[id^="gform_"] select').on('change', function (e) { | |
$(this).addClass('has-selection'); | |
}); | |
//Disable the GF submit button until all required fields are completed | |
$('form[id^="gform_"]').on('change', function (e) { | |
var $reqd = $(this).find('.gfield_contains_required').filter(function (i, c) { | |
return [] | |
.concat($(c).find('input[type="text"], input[type="email"], textarea').filter(function (i, fl) { return $(fl).val().length == 0; }).get()) |
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
//Show toggle sections link clicks | |
$(document).ready(function() { | |
if ( window.location.href.indexOf("SLUG OF PAGE") > -1 && window.location.href.indexOf("#") > -1) { | |
var tab = window.location.href.split('#')[1]; | |
$('[data-bucket = "' + tab + '"]').addClass('active'); | |
$('#' + tab).addClass('active show').css('display', 'flex'); | |
} | |
}); |