Skip to content

Instantly share code, notes, and snippets.

View themightymo's full-sized avatar

Toby Cryns themightymo

View GitHub Profile
@themightymo
themightymo / .htaccess
Created January 25, 2023 18:49
Default Siteground WordPress .htaccess
# SGS XMLRPC Disable Service
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
# SGS XMLRPC Disable Service END
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
@themightymo
themightymo / redirect_wp_uploads_to_s3
Last active October 23, 2020 17:13
Redirect WordPress "uploads" folder to S3 bucket via .htaccess
# BEGIN Utilize S3 bucket rather than localhost for "uploads" folder - Via https://tinyurl.com/s3redirect
RewriteRule ^wp-content/uploads/(.*)$ https://your_bucket_name.s3.amazonaws.com/wp-content/uploads/$1 [R,L]
# END Utilize S3 bucket
@themightymo
themightymo / gist:45cddd09c9fdbddba54c55acb38477a1
Created October 20, 2020 14:10
Remove/Disable WordPress Featured Images/Thumbnails in functions.php or plugin
/*
Disable auto-generated thumbnails. Via
- https://wordpress.stackexchange.com/questions/91166/how-to-disable-wordpress-from-creating-thumbnails
- https://wordpress.stackexchange.com/questions/260609/remove-image-size-doesnt-seem-to-be-working
*/
function add_image_insert_override($sizes){
unset( $sizes['thumbnail']);
unset( $sizes['medium']);
return $sizes;
}
@themightymo
themightymo / gist:ccfdf28cc614e9822bb4e695b17eb3db
Created June 22, 2020 14:13
Sequel Pro: How to update WordPress Password using md5 hash
/**
* https://fewerthanthree.com/code-snippets/updating-user-password-mysql
*/
UPDATE wp_users
SET user_pass= MD5('password')
WHERE ID = 1
@themightymo
themightymo / Style Gravity Forms with Labels in the Fields
Last active April 20, 2020 19:30
Style Gravity Forms with Labels in the Fields
/*
* BEGIN style Gravity Forms placeholder text
*/
.gform_wrapper .gfield_radio li label {
max-width: 100%;
}
.gfield input::-webkit-input-placeholder,
.gfield textarea::-webkit-input-placeholder,
.gfield select::-webkit-input-placeholder {
/* Chrome/Opera/Safari */
@themightymo
themightymo / .gitignore NEW
Last active January 18, 2023 23:40 — forked from jjeaton/.gitignore
WordPress root .gitignore. Ignore everything and then opt-in (exclude from the ignore) for your custom code.
# codekit #
###########
.sass-cache/
.codekit-config.json
.config.codekit
# wpengine #
############
*~
@themightymo
themightymo / recommended-gitignore-wp
Last active August 2, 2016 21:43
Recommended .gitignore file for WP Engine