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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dustinleer
dustinleer / functions.php
Last active August 3, 2020 17:04
Enqueue Scripts
<?php
/**
* Enqueue scripts and styles.
*/
function custom_scripts() {
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'svg_magic', get_stylesheet_directory_uri() . '/js/jquery.svgmagic.js', array(), '20120206', true );
wp_enqueue_script( 'functions', get_stylesheet_directory_uri() . '/js/functions.js', array(), '20130115', true );
}
add_action( 'wp_enqueue_scripts', 'custom_scripts' );
@dustinleer
dustinleer / functions.js
Created December 4, 2018 17:57
SVG Magic Function
jQuery(document).ready(function(){
jQuery('img').svgmagic();
});
@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 / 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 / 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 / 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 / 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,
<?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