Web Dev Snippets

A collection of (mostly) WordPress/ClassicPress-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 other snippets or references.

Incorporating Dashicons into Content and Templates

Two approaches for adding dashicons in HTML, using WordPress native CSS. <h2 class="dashicons-before dashicons-smiley">A Cheerful Headline</h2> <h2><span class="dashicons dashicons-smiley"></span> A Cheerful Headline</h2> Both would appear like [...]
WP/CP | Type: PHP

jQuery Better Show-Hide

A show-hide that still works(?not tested lately); changes toggle content.
Javascript, jQuery | Type: Javascript

Linear Gradients

Add gradients without the use of background images.
CSS3 | Type: CSS

Loading acf/init properly

This code wraps ‘acf_add_options_page’ code (usually in the theme functions file): add_action('acf/init', 'my_acf_init'); function my_acf_init() { // Get ACF version. $version = acf_get_setting('version'); // add options [...]
ACF | Type: PHP