Skip to content

Instantly share code, notes, and snippets.

View CapWebSolutions's full-sized avatar

Matt Ryan CapWebSolutions

View GitHub Profile
@CapWebSolutions
CapWebSolutions / .htaccess
Last active January 29, 2019 22:49
Harden folder from outside access
deny from all
@CapWebSolutions
CapWebSolutions / hide_the_author_rss.php
Created November 27, 2018 21:15
Remove author name from RSS feed.
/**
* Hide the author
*
* Hide the post author on the standard RSS feed if it matches a preset value.
*
* @link https://capwebsolutions.com
*
* @package WordPress
* @since 1.0.0
* @license GNU General Public License 2.0+
@CapWebSolutions
CapWebSolutions / 00-wordpress-debug.php
Last active August 3, 2021 20:18
[WordPress] Tools For WordPress Projects
<?php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
@ini_set( 'display_errors', 1 );
define( 'SCRIPT_DEBUG', true );
define( 'SAVEQUERIES', true );
@CapWebSolutions
CapWebSolutions / remove-IE-focus-outline.css
Created June 26, 2018 19:06
IE 10/11 displays outline on any clicked div. This css snippet removes that outline.
/* Added to remove outline on any clicked div when displyed in IE 11 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/* IE10+ CSS styles go here */
:focus {
outline: none;
}
}
@CapWebSolutions
CapWebSolutions / phpinfo.php
Created June 22, 2018 23:06
Save file to root of website. Run example.com/phpinfo.php to see what PHP services are running. Delete file when done. Don't leave it on your serveer.
<?
phpinfo();
?>
@CapWebSolutions
CapWebSolutions / bust-it.php
Created June 18, 2018 16:33
Auto cache busitng on css and js based on file time stamp.
/**
* Never worry about cache again!
*/
function my_load_scripts($hook) {
// create my own version codes
$my_js_ver = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/custom.js' ));
$my_css_ver = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'style.css' ));
//
@CapWebSolutions
CapWebSolutions / gf-consent.php
Created June 4, 2018 16:35
Add text AFTER submit button on Gravity Forms form
@CapWebSolutions
CapWebSolutions / load-media-from-prod.sh
Last active September 21, 2018 19:10
Load media files from production server if they don't exist locally - htaccess tweak
# Load media files from production server if they don't exist locally
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$
RewriteRule ^(.*)$ https://<insert-production-sitedomain>/$1 [QSA,L]
</IfModule>
# Sep 2018 - Simplified using css-tricks.com recommendation
# Feb 2018 - verified working on local by flywheel
@CapWebSolutions
CapWebSolutions / don't-update-plugin.php
Created May 30, 2018 15:15
Do not check for plugin or theme update. Include in core functionality plugin.
/**
* Don't Update Plugin
*
* @since 1.0.0
*
* This prevents you being prompted to update if there's a public plugin
* with the same name.
*
* @author Mark Jaquith
* @link http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/
@CapWebSolutions
CapWebSolutions / first_date_footer.php
Created May 24, 2018 13:09
Function to automatically plug the date of first post into footer for copyright purposes.