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.

Anonymize IP in Google Analytics»

Set anonymizer after UA code: <!-- Google Analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-Y', 'auto'); ga('set', 'anonymizeIp', true); ga('send', 'pageview'); </script> <!-- End Google Analytics -->
Security, Sharing, WP/CP | Type: Javascript

Audio Embed»

See result on nmctr.org
Media | Type: Other

Basic WP-query»

As basic as it gets, for clarity's sake.
WP Query | Type: PHP

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

Clear Clipboard»

There are glitches with Dreamweaver and possibly with OSX that prevent copying text occasionally. So far the only thing I’ve found that works is to clear the clipboard via Terminal…
clipboard, pasteboard | Type: Other

Clearfix»

Maybe the most widely used clear after float.
CSS | Type: CSS

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