When your website means business.

Snippets

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.

PHP 7.2 Countable issue»

Before PHP 7.2 when passing a non-array to count(), it returned 1. With 7.2, count() emits a warning when you give it a non-array.
PHP | Type: PHP

Pre Get Posts»

Set up query parameters for different CPT archives.
WP Query | Type: PHP

Proportional scaling of a container»

There is more detail at the reference link for complex containers. .parent { height: 0; padding-bottom: 56.25%; /* 16:9 */ position: relative; } .child { position: absolute; top: 0; left:…
CSS | Type: CSS

Pseudo Classes»

Some very handy classes and selectors to know.
CSS | Type: CSS

Pure CSS triangle»

Creates a triangle shape with nothing but CSS. Note that the border placement and color dictates triangle color and direction of pointer (opposite the visible border).
CSS | Type: CSS

Menu
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept