A collection of (mostly) WordPress-related snippets and references I’ve found useful and worth keeping where I can find them. Feel free to use what you like, and point me to some better snippets or references.
CSS Grid Layout»
The smart way to do layout.
CSS | Type: CSS
CSS Transitions»
Some transition basics.
Animation, CSS3 | Type: CSS
CSS-only Accordians»
When javascript doesn’t make the grade. HTML <div class="wrapper"> <div class="half"> <p>Open multiple</p> <div class="tab"><input id="tab-one" name="tabs" type="checkbox" /> <!--can open several tabs at once--> <label for="tab-one">Label One</label> <div class="tab-content">…
CSS, Javascript | Type: CSS
CSS-only Mobile Menu»
Mobile menu that doesn't use javascript. Uses hidden checkbox to toggle state.
CSS, Responsive | Type: CSS
CSS3 Multiple Columns»
Unfortunately, this is buggy with uneven column lengths. There may be some javascript that does this better.
CSS3 | Type: CSS
Custom Login Logo and Logo Link»
Add other styles as necessary.
Custom Admin | Type: CSS
Custom Text in Admin Footer»
This replaces the "Thank you for creating with WordPress" message.
Custom Admin | Type: PHP
Custom TinyMCE Styles»
Consider replacing current approach with this plugin (still need to remove h1, blockquote, etc from formats)
Custom Admin, TinyMCE, Users | Type: PHP
Disable Gutenberg for selected Custom Post Types»
function my_disable_gutenberg( $current_status, $post_type ) { // Disabled post types $disabled_post_types = array( 'book', 'movie' ); // Change $can_edit to false for any post types in the disabled post types…
CPT, PHP, WP/CP | Type: PHP
Disable WordPress Default Image Link»
Disable annoying default image link in theme functions file. You can still make a link, but it won't be the default.
Custom Admin, Users | Type: PHP