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.
Accessible Hiding of Elements with CSS»
Developers commonly use display: none to hide content on the page. Unfortunately, this simple and common action can be problematic for users of screen readers. Below is a better way:…
Accessibility, CSS | Type: CSS
Accessible Vertical Tabbed Menu»
From @codepotent, can be easily modified as needed.
CSS, Javascript | Type: CSS
ACF Basic Template Tags»
Simple template tag; no conditional.
ACF | Type: PHP
ACF Images: ID»
By using the ID, you can retrieve any crop size of the image and even get the name of the file!
ACF | Type: PHP
ACF Images: Image Array»
Select'Image Object' option to access an array of image attributes. Useful for thumbnail support.
ACF | Type: PHP
ACF Option for ‘Very Simple’ WYSIWYG Toolbar»
ACF add very simple wysiwyg toolbar option (functions.php).
ACF | Type: PHP
ACF Pro Site Options»
For some reason, this HAS to be added to functions.php; MU plugin does not work.
ACF | Type: PHP
ACF Random Image Repeater»
Example shows creating random background image for header.
ACF | Type: PHP
ACF Repeater Conditional»
Conditional based on having field values
ACF | Type: PHP
ACF Repeater Gallery (Image Array)»
This example shows a full page width, with 4 gallery images across. The 'rel="lightbox"' bit triggers the modal window for the lightbox plugin.
ACF, Gallery | Type: PHP