Skip to content

Instantly share code, notes, and snippets.

View dustinleer's full-sized avatar
🏠
Working from home

Dustin Leer dustinleer

🏠
Working from home
View GitHub Profile
@dustinleer
dustinleer / script-file.js
Last active September 17, 2021 14:12
Moving Nav Items
var
// NAV
navbutton = $('.menu-toggle'),
navWrap = $('.main-nav-wrapper'),
navmenu = $('.main-nav'),
servicemenu = $('.service-menu'),
// WATCHER
watcher = window.matchMedia("(max-width: 1179px)");
@dustinleer
dustinleer / woocommerce.php
Created August 4, 2020 13:53
This will check if upsells are active on the page and if they are none will show the realted products
<?php
// REMOVE RELATED IF UPSELLS
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
add_action( 'woocommerce_after_single_product_summary', 'related_upsell_products', 15 );
function related_upsell_products() {
global $product;
<?php
/* == Queue up all css & js files ==================================================== */
function theme_scripts_styles() {
// JS
/** Removes WP stock jQuery
* https://developer.wordpress.org/reference/functions/wp_deregister_script/
*/
wp_deregister_script( 'jquery' );
/** Adds jQuery from a CDN, loads in the footer
@dustinleer
dustinleer / synced-slick.js
Last active August 3, 2020 17:06
Synced Slick Slider
$('.slick-nav.sync').slick({
slidesToShow: 7,
slidesToScroll: 1,
asNavFor: '.slick-slider.sync',
dots: false,
arrows: false,
fade: false,
centerMode: false,
// centerPadding: '50px',
focusOnSelect: true,
@dustinleer
dustinleer / header.php
Created June 7, 2019 17:19
Do you need to move nav items in a complicated navigation? Here's what I did for a solution on a WordPress site that had 3 separate navs that needed to become one at a certain breakpoint for mobile and then resume their normal states when not at that breakpoint for desktop.
<?php
// Site specific vars
$lang_att = get_language_attributes();
$charset = get_bloginfo( 'charset' );
$pingback = get_bloginfo('pingback_url');;
$site_url = get_bloginfo( 'wpurl' );
$site_name = get_bloginfo( 'name' );
// Get Body Classes then turn them into string values
@dustinleer
dustinleer / overcast-fm-dark.css
Last active December 14, 2021 16:43
Overcast FM Web Darkmode
html, input, select, textarea, .pure-g [class *= "pure-u"] {
font-family: concourse_t3, Helvetica, sans-serif;
}
body {
background: #1c1a1a;
color: #fff;
font-size: 18px;
max-width: 700px;
margin: 0 auto;
@dustinleer
dustinleer / sharethis.js
Last active December 11, 2019 20:26
Sharethis a11y Functionality jQuery
jQuery(document).ready(function($) {
setTimeout(function(){
//--------------------------
// SHARETHIS a11y
//--------------------------
// Loop through an array of data-network names
['facebook', 'twitter', 'pinterest'].forEach(function( platform ) {
// Adds a11y to sharing icons
$('.st-btn[data-network="' + platform + '"').attr({
@dustinleer
dustinleer / functions.php
Last active August 3, 2020 17:05
Add function for SVG mime type
<?php
/*add SVG functionality*/
function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');
@dustinleer
dustinleer / functions.js
Created December 4, 2018 17:57
SVG Magic Function
jQuery(document).ready(function(){
jQuery('img').svgmagic();
});