A collection of (mostly) WordPress/ClassicPress-related snippets and references I’ve found useful and worth keeping where I can find them.
NOTE: Some of these snippets are old and may be outdated. Feel free to use what you like, and point me to better snippets or references.
Center content horizontally and vertically in flexbox
.container { display: flex; flex-wrap: wrap; place-content: center; }
CSS, FlexBox | Type: CSS
Change background and color of Chrome autofill
.top .search-form input:-webkit-autofill, .top .search-form input:-webkit-autofill:hover, .top .search-form input:-webkit-autofill:focus, .top .search-form input:-webkit-autofill:active { -webkit-box-shadow: 0 0 0 100px #222 inset !important; -webkit-text-fill-color:#fff!important; }
CSS, Forms | Type: CSS
Change WordPress Sender Email
Less system-generated email will end up in spam folders if it's a legitimate email address.
WP/CP | Type: PHP
Child Theme Style Header
Header info for child theme style sheet.
Child Theme, CSS, WP/CP | Type: CSS
Clear Input Field on Focus
Not sure why you wouldn't use a placeholder instead.
Forms | Type: Javascript
Clearfix
Maybe the most widely used clear after float.
CSS | Type: CSS
Common WP functions converted to variables
Sometimes functions are easier to use in conditional statements if converted to variables.
ACF, PHP, WP/CP | Type: PHP
Compression – wp-config
Enable compression in wp-config /* Compression */ define( 'COMPRESS_CSS', true ); define( 'COMPRESS_SCRIPTS', true ); define( 'ENFORCE_GZIP', true );
wp-config | Type: PHP
Conditional Based on Field Value
Conditional based on values for single-value fields (radio buttons, select, etc).
ACF, PHP | Type: PHP
Conflicting Scripts
This constant is enabled by default and means that all JavaScript files are loaded with a single call, rather than multiple calls to multiple files (faster [...]
Troubleshooting | Type: Javascript






