I hereby claim:
- I am bigwilliam on github.
- I am bigwilliam (https://keybase.io/bigwilliam) on keybase.
- I have a public key ASDkUaWUk4TR5dm5VkcZPO3BAfCGq81Sg5xGitzpazGe4Qo
To claim this, I am signing this object:
| ### BEGIN FORCE WWW OR NON-WWW | |
| <ifModule mod_rewrite.c> | |
| RewriteEngine on | |
| RewriteBase / | |
| #Force non-www: | |
| #RewriteCond %{HTTP_HOST} www.(.*)$ [NC] | |
| #RewriteRule ^(.*)$ http://%1/$1 [R=301,L] | |
| #Force www: |
I hereby claim:
To claim this, I am signing this object:
| # Please reference this article for the full description: https://perishablepress.com/3-ways-preload-images-css-javascript-ajax/ | |
| window.onload = function() { | |
| setTimeout(function() { | |
| // XHR to request a JS and a CSS | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', 'http://domain.tld/preload.js'); | |
| xhr.send(''); | |
| xhr = new XMLHttpRequest(); | |
| xhr.open('GET', 'http://domain.tld/preload.css'); |
| // Place this BEFORE the WordPress Rewrite rules | |
| // Be sure to edit LOCALHOST and LIVESITE with the proper URL's | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase /wp-content/uploads/ | |
| RewriteCond %{HTTP_HOST} ^LOCALHOST\.dev$ [NC] | |
| RewriteCond %{REQUEST_URI} ^/wp-content/uploads/ | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteCond %{REQUEST_FILENAME} !-f |
| /* | |
| * => FULL SCREEN | |
| * => Author: William <[email protected]> | |
| * ---------------------------------------------------------------------------*/ | |
| /*** Set these vars to the correct elements ***/ | |
| var fullScreenEl = '#fullScreenMe'; // This is the section/wrapper which should occupy the screen | |
| var keepOnScreen = ['#keepOnScreen', '#wpadminbar', '.masthead']; // Siblings of FullScrenEl to keep on screen (i.e. header nav) |
| .gform_wrapper ul { | |
| @extend .list-unstyled; | |
| } | |
| .gform_wrapper li { | |
| @extend .form-group; | |
| } | |
| .gform_wrapper form { | |
| margin-bottom: 0; |
| // Add login/logout links to the footer navigation | |
| // This will filter through the menu items and look for the footer-menu. | |
| // Then append login/logout links to the end | |
| function add_loginout_menu_to_footer( $items, $args ) { | |
| // only add login/out items to the footer menu | |
| if ( is_admin() || $args->theme_location != 'footer-menu' ) // change 'footer-menu' to the name of the menu you want to add the login links to. i.e. change to 'primary' to add links to the primary menu | |
| return $items; | |
| $link = wp_loginout( $redirect = home_url(), $echo = false ); // use wp_loginout() to return the correct login OR logout link strings | |
| // append our new list item to the current menu list items and return it |
| // This tip solves the issue of WooCommerce stylesheets being loaded after your custom ones. | |
| // Which will save you from having to add !important, or getting overly specific with your CSS styles. | |
| // Just make sure the WooCommerce syles are listed as a dependency, which automatically puts your CSS after WooCommerce | |
| function my_custom_scripts() { | |
| wp_enqueue_style(‘custom-css’, get_stylesheet_directory_uri().’/main.css’, array(‘woocommerce-general’)); | |
| /*** Deprecated method *** | |
| // place wooCommerce styles before our main stlesheet |
| /* | |
| Log Me - Debug Function | |
| @param {string} $message Message that you would like to pass to the debug.log file. | |
| */ | |
| function post_debug( $message ) { | |
| if ( WP_DEBUG === true ) { | |
| if ( is_array( $message ) || is_object( $message ) ) { | |
| error_log( print_r( $message, true ) ); | |
| } else { | |
| error_log( $message ); |