As the lengthy title says, the follow simple script allows you to use a shortcode to dynamically output the number of years since a specified date. I wrote this for my own bio, which I used to have to update the number of years since the start of my employment once a year. The simple’r … continue reading »
For demo/home sites of a theme/plugin that wish to include the projects main readme files as part of the website, this quick snippet loads the folders README.md file, and parses the MarkDown (to githubs flavour) with a awesome jQuery plugin, all with the simple call of a [readme] shortcode.
Update: I now use vvv on Dropbox instead, it’s a much simpler setup, more time building, less time with system admin work. Prerequisite: you have a normal localhost LAMP setup, and your localhost/~username/ host serves the contents of ~/Sites/. If you don’t here’s the best step-by-step to get it running. Alright, lets go: iCloud drive … continue reading »
I’ve used many syntax highlighters over the years for pasting and sharing code snippets. In that time I’ve never had any luck with WordPress ones that save the snippets save in post_content. In my experience with it, there seems to be this constant battle for the characters being escaped or not, especially when switching between … continue reading »
One of the most annoying features of WordPress Multisites (besides domain mapping) is adding a Super Admin a few years after your network is established and grown. Sure, being a Super Admin allows said user to access any site on the network, but the user is technically not added to the site – so the … continue reading »
Building a PHP app that communicates with Slack a lot, I found it was much cleaner to tuck everything away in a function and call it in a single function that resembles the attributes of mail(). This makes for changing your apps icon andor color easy, as well as staying consistent with the Title and … continue reading »
I remember all the custom solutions and plugins needed before this was supported in WordPress 4.4. A great snippet to have in your toolbox. I’ve reduced it to the bare basics.
When using a custom post type for portfolio items, I needed several of them to be password protected, showing a lock icon instead of the portfolio item. The posts are shown via a normal loop, but they’re just thumbnails with lightbox links. To password protect them all, and have them all unlock with a single … continue reading »
Turning WordPress Categories into hashtags in URL and in common locations (not all) on site:
Paste the following in the USER keymap via PREFERENCES > KEYBINDINGS to have cmd+f always include the REPLACE portion while using FIND in Sublime 3:
The following script stores the first result from Google Maps v3 API AutoComplete into a hidden input, allowing you to do something with the autocomplete input field if the user decides to type their address instead of click a result. I’ve included only the extra code ontop of the normal autoComplete script.
Every developer has these all-day'er's. What in the happenings of happenings is happening. I had it with one of my favourite tools wp-cli something I rely on heavily for my workflow. Clean installed, valid versions, so on. wp list plugins returned all good. However any real writing like wp plugin update –all failed. And the … continue reading »