Skip to content

Instantly share code, notes, and snippets.

View michaeldozark's full-sized avatar

Michael Dozark michaeldozark

View GitHub Profile
@michaeldozark
michaeldozark / cross-hover.css
Created May 4, 2017 18:30
Crossed hover effect on rows and columns
.cross-hover {
overflow: hidden;
}
.cross-hover tr:hover,
.cross-hover tr:focus {
background: rgba(191,148,86,.25); /* whatever color you like */
}
.cross-hover thead tr,
@michaeldozark
michaeldozark / .gitignore
Last active May 25, 2017 14:54
.gitignore file for WordPress builds
wp-content/cache
wp-content/themes/twenty*
wp-content/upgrade
wp-content/uploads
wp-config-sample.php
wp-config.php
bower_components/
node_modules/
.bowerrc
.DS_Store
@michaeldozark
michaeldozark / WordPress Dev Server .htaccess
Created October 10, 2016 20:23
Loads images from production server if they don't exist on local so we don't have to download or copy the uploads directory. Thanks to @stevegrunwell
<IfModule mod_rewrite.c>
RewriteEngine on
# Attempt to load files from production if
# they're not in our local version
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule wp-content/uploads/(.*) \
http://{PROD}/wp-content/uploads/$1 [NC,L]
</IfModule>
@michaeldozark
michaeldozark / acf-states.txt
Last active October 4, 2021 16:31
State list for Advanced Custom Fields select field
AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
CT : Connecticut
DE : Delaware
DC : District of Columbia
FL : Florida
@michaeldozark
michaeldozark / parent-theme-style.php
Last active December 12, 2016 16:57
Best way to include parent theme styles when the child theme is already properly enqueued
<?php
/**
* Hook our function. We are using priority 100 to make sure it fires AFTER
* the theme stylesheet is registered/enqueued.
*
* @link https://developer.wordpress.org/reference/hooks/wp_enqueue_scripts/
* Description of `wp_enqueue_scripts` hook
*/
add_action( 'wp_enqueue_scripts', 'slimline_enqueue_template_stylesheet', 100 );
@michaeldozark
michaeldozark / gist:1968a9d7da91f4d0f5bf
Created May 13, 2015 04:25
MIME types for cPanel compression
text/html text/plain text/xml text/css text/javascript application/javascript application/xhtml+xml application/xml application/rss+xml application/atom_xml application/x-javascript application/x-httpd-php application/x-httpd-fastphp application/x-httpd-eruby image/svg+xml
@michaeldozark
michaeldozark / slimline_wp_vars
Last active August 29, 2015 14:15
Javascript conversion of WordPress vars.php needed for when I am using page caching, but still need browser-based body classes, etc.
/**
* Slimline WordPress Globals
*
* Javascript conversion of WordPress vars.php needed for when I am using page caching, but still need browser-based body classes, etc.
*
* @link https://gist.github.com/michaeldozark/17412e3eeda6b391ae8c
* @version 0.1.0
*/
/**
@michaeldozark
michaeldozark / get_terms_orderby_name_as_number
Created September 12, 2014 19:35
Order terms by name cast as a number. Originally used for retrieving WooCommerce attributes. To use, set the 'orderby' argument in your `get_terms` call to 'name_as_number'.
add_filter( 'get_terms_orderby', 'slimline_get_terms_orderby_name_as_number', 10, 2 );
/**
* slimline_get_terms_orderby_name_as_number function
*
* @param string $orderby The orderby string created from the initial arguments passed through `get_terms`
* @param array $args `get_terms` arguments
* @return string $orderby Name cast as a number if `orderby` is 'name_as_number', otherwise unchanged
*/
function slimline_get_terms_orderby_name_as_number( $orderby, $args ) {
@michaeldozark
michaeldozark / login.php
Last active July 29, 2016 19:37
Style the login screen. Make sure to read my comment below as well.
<?php
/**
* Login Functions
*
* Functions and filters that run only on the WordPress login screen.
*
* @package Slimline
* @subpackage Login
*/
@michaeldozark
michaeldozark / get-terms-custom-order.php
Last active August 29, 2015 14:03
Filters get terms in the order the term_ids are listed in the `include` parameter of get_terms.
<?php
add_filter( 'get_terms_args', 'slimline_get_terms_args', 0 ); // allow extra filtering of terms arguments
/**
* slimline_get_terms_args filter
*
* Adds additional filtering to get_terms as needed.
*
* @param array $args An array of arguments passed from the get_terms() function