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 / functions.php
Created July 20, 2021 18:11 — forked from srikat/functions.php
How to set up smooth scrolling for hash links in WordPress. https://sridharkatakam.com/set-smooth-scrolling-hash-links/
// Enqueue site-wide scripts
add_action( 'wp_enqueue_scripts', 'sk_enqueue_scripts' );
function sk_enqueue_scripts() {
wp_enqueue_script( 'global', get_stylesheet_directory_uri() . '/js/global.js', array( 'jquery' ), '', true );
}
@dustinleer
dustinleer / disable-guteberg-widgets.php
Created September 17, 2021 13:59
Disables Gutenberg for the Widget Area in WordPress
// Disables the block editor from managing widgets in the Gutenberg plugin.
add_filter( 'gutenberg_use_widgets_block_editor', '__return_false', 100 );
// Disables the block editor from managing widgets.
add_filter( 'use_widgets_block_editor', '__return_false' );
if ( ! function_exists( 'themename_activate_classic_widgets' ) ) :
function themename_activate_classic_widgets() {
remove_theme_support( 'widgets-block-editor' );
}
@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 / admin-styles.php
Last active September 21, 2021 09:58
Override Admin Styles
// customize admin bar css
function override_admin_bar_css() {
if ( is_admin_bar_showing() ) {
/* Could add a custom enqueue here instead of a style tag */
/* Example 👇 */
$version = time();
wp_enqueue_style( 'ip_master-style', get_stylesheet_directory_uri() . '/dist/css/style.css', array(), $version );
?>
<style type="text/css">
/* Add Styles Here */
@dustinleer
dustinleer / browser-dectection.js
Created September 21, 2021 15:28
Adds body class based on browser detection
function GetIEVersion() {
var sAgent = window.navigator.userAgent;
var Idx = sAgent.indexOf("MSIE");
// If IE, return version number.
if (Idx > 0) {
return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(".", Idx)));
// If IE 11 then look for Updated user agent string.
@dustinleer
dustinleer / full-width.css
Created September 28, 2021 19:00
Full width outer container inside a fixed container
.full-width {
width: 100vw;
position: relative;
left: 50%;
right: 50%;
margin-left: -50vw;
margin-right: -50vw;
}
@dustinleer
dustinleer / node-nodes.md
Created November 8, 2021 15:03
Gulp Issues

Ref Link


Gulp 3.* doesn't work on Node 12.* or above. You have to downgrade Node, or upgrade Gulp.

If you are short on time, downgrade Node to v11.* or below; if you need newer features, and have time to possibly fix a load of broken dependencies, upgrade Gulp to 4.* or above!

As others have already mentioned, Gulp 3.* is not supported on Node 12 or above, so you will have to downgrade your Node version to 11.* or below, OR upgrade your Gulp to 4.0.

@dustinleer
dustinleer / NodeSass.md
Last active November 15, 2021 14:40
Node Sass and NPM Build Issues

To Rebuild Node Sass, these commands are helpful.

npm uninstall node-sass
npm i node-sass
npm rebuild node-sass
@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 / sass.md
Last active January 14, 2022 23:03
Plain Sass Example