Skip to content

Instantly share code, notes, and snippets.

Working from home

Dustin Leer dustinleer

Working from home
View GitHub Profile
eriktdesign / generate-wpe-gitignore
Created September 23, 2021 17:42
Generate a .gitignore file based on WP Engine's WordPress .gitignore
View generate-wpe-gitignore
if [ "$1" != "" ]; then
if test -f "$FILE"; then
echo ".gitignore exists, aborting."
dustinleer / script-file.js
Last active September 17, 2021 14:12
Moving Nav Items
View script-file.js
// NAV
navbutton = $('.menu-toggle'),
navWrap = $('.main-nav-wrapper'),
navmenu = $('.main-nav'),
servicemenu = $('.service-menu'),
watcher = window.matchMedia("(max-width: 1179px)");
eSaner / wp-cli_update_multi_posts.txt
Last active January 31, 2023 22:18
Update multiple posts with WP-CLI
View wp-cli_update_multi_posts.txt
* Command line
* @source
for id in $(wp post list --post_type=my_post_type --fields=ID --format=ids); do wp post update $id --post_title="Page Number $id"; done
amboutwe / yoast_seo_breadcrumb_remove_link.php
Last active February 13, 2023 23:59
These snippets are examples of how you can modify the Yoast SEO breadcrumb visual output. These snippets will not alter the breadcrumb schema output. Please consult the schema documentation to change the breadcrumb schema:
View yoast_seo_breadcrumb_remove_link.php
srikat / functions.php
Last active July 20, 2021 18:11
How to set up smooth scrolling for hash links in WordPress.
View functions.php
// 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 );
yratof / functions.php
Created June 2, 2015 12:35
Getting the Video ID from ACF OEmbed, then using that ID to call in videos without bloat
View functions.php
/* Parse the video uri/url to determine the video type/source and the video id */
function parse_video_uri( $url ) {
// Parse the url
$parse = parse_url( $url );
// Set blank variables
$video_type = '';
$video_id = '';
salcode / .gitignore
Last active November 12, 2022 00:27
Please see for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
View .gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
# From the root of your project run
# curl -O
# to download this file
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
omurphy27 / Gravity Forms WP CSS Honeypot styling.css
Last active June 20, 2022 02:10
Gravity Forms WP CSS Honeypot styling.css
View Gravity Forms WP CSS Honeypot styling.css
.gform_wrapper .gform_validation_container,
body .gform_wrapper li.gform_validation_container,
body .gform_wrapper .gform_body ul.gform_fields li.gfield.gform_validation_container,
body .gform_wrapper ul.gform_fields li.gfield.gform_validation_container {
display: none !important;
position: absolute !important;
left: -9000px;
nroca / gist:511ef1d287ba7121f596
Created October 9, 2014 05:39
ACF Options Page (Icon/Position)
View gist:511ef1d287ba7121f596
acf_add_options_page( array(
'page_title' => 'Home Page Sliders',
'menu_title' => 'Sliders',
'menu_slug' => 'home-page-sliders',
'capability' => 'edit_posts',
'icon_url' => 'dashicons-images-alt2',
'position' => 7
bappi-d-great / How to load a wordpress plugin at very last.php
Created September 6, 2014 14:47
How to load a wordpress plugin at very last - change plugin order to load last
View How to load a wordpress plugin at very last.php
* Use the code at the beginning of a plugin that you want to be laoded at last
function this_plugin_last() {
$wp_path_to_this_file = preg_replace('/(.*)plugins\/(.*)$/', WP_PLUGIN_DIR."/$2", __FILE__);
$this_plugin = plugin_basename(trim($wp_path_to_this_file));
$active_plugins = get_option('active_plugins');