Skip to content

Instantly share code, notes, and snippets.

View shrinkray's full-sized avatar
:octocat:
Focusing

Greg Miller shrinkray

:octocat:
Focusing
View GitHub Profile
# Requirements
# To work correctly, you will first need:
# zsh (v5.2 or recent) must be installed.
# Powerline Font must be installed and used in your terminal (for example, switch font to Fira Code).
ZSH_THEME="spaceship"
# Set Spaceship ZSH as a prompt
@shrinkray
shrinkray / setup.php
Created January 25, 2021 14:48
Enqueue Child Theme CSS from Task Runner Webpack Bundler
/** Enqueue Child Theme JavaScript
* Function adds JS after other plugins
@created for a child theme named Mowtown Ecommerce
@parent is Shopical Pro from AF Themes
*/
function enqueue_after_wc() {
// vars
@shrinkray
shrinkray / functions.php
Last active January 25, 2021 19:32
Add modular function partials to the function.php for a customized WordPress child theme
/**
* Theme Includes
*
* The $theme_includes array determines the code library included in your theme.
* Add or remove files to the array as needed. Supports child theme overrides.
* @parent shopical pro from AF Themes
*
* Please note that missing files will produce a fatal error.
*
*/
@shrinkray
shrinkray / .gitignore
Last active March 9, 2021 21:22
Ignore all except theme and plugins for public root repos
# .gitignore file for WordPress. Ignores everything except theme and plugins.
# Located in the root folder
# based on https://gist.github.com/jdbartlett/444295
# Broad capture
/*
# Host and php files
*wp-*.php
@shrinkray
shrinkray / sql
Created April 10, 2020 23:03
Remove ACF Field Post Meta from Database
DELETE FROM wp_postmeta
WHERE wp_postmeta.meta_key = "custom_field_name"
OR wp_postmeta.meta_key = "_custom_field_name"
@shrinkray
shrinkray / .zshrc
Last active February 13, 2020 20:13
My Z-shell template
# If you come from bash you might have to change your $PATH.
# ( Removed )
# Path to your oh-my-zsh installation.
# ( Removed )
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@shrinkray
shrinkray / enqueue-hash.php
Last active December 28, 2019 15:47
Webpack with hash filenames, Methods to enqueue
<?php
/**
* Enqueue a Hashed JS and CSS from Webpack
* Set theme stylesheet after WooCommerce.
*/
function enqueue_style_after_wc() {
// include the css file as hashed version
@shrinkray
shrinkray / Custom_Walker_Nav_Menu.php
Created December 23, 2019 02:13 — forked from gregrickaby/Custom_Walker_Nav_Menu.php
Add HTML Markup to WordPress Nav Menu Editor
<?php
/**
* Create HTML list of nav menu items.
*
* @since 3.0.0
* @uses Walker
*/
class Custom_Walker_Nav_Menu extends Walker_Nav_Menu {
/**
@shrinkray
shrinkray / functions.php
Created December 22, 2019 03:13
Add a data attribute of page/post to a WordPress Menu ( wp_nav_menu() )
/**
* Add a data attribute of page/post to a WordPress Menu
* Add this to your functions.php file
*
* This function will add the page/post ID of item the menu links to
* when using wp_nav_menu(); to build the menu.
*
* Example:
*
@shrinkray
shrinkray / .gitignore
Created December 18, 2019 13:33
A gitignore to use with git where root is in root of WP install, from WP Engine
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
# THEME LEVEL FILES
wp-content/themes/root-inc/vendor
wp-content/themes/root-inc/.config.codekit3
# Reference Files
wp-content/themes/root-inc/brand-colors.css
#Added gitignore_global to ignore .DS_Store instances
wp-content/themes/root-inc/videos