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 »
Knowing how my server is preforming at all times kind of an hobby with mine. I know I can subscribe to some tools and services that display this info in beautiful graphics and charts, but I like simple things, and I like using default stuff. Years ago I wrote about a similar script to this, that used this … continue reading »
I write in LESSCSS because I find it’s nesting so much eaiser to read. While creating a theme, I never compile during, it’s too annoying, instead I have a on/off toggle for using .LESS file or .CSS file. In the snippet I made the toggle WP_DEBUG, which should be on while you develop, but if … continue reading »
The documentation left this out, but if you want to remove some post formats from a WordPress child theme, the remove_theme_support( ‘post-formats’) does not allow you to pass an array of formats, it’s just a hard switch. However you can over-write the original add_theme_support(‘post-formats’) with only formats you desire.
According to my previous understanding and WordPress’s documentation: Note that the function called by the shortcode should never produce output of any kind. Shortcode functions should return the text that is to be used to replace the shortcode. Producing the output directly will lead to unexpected results So, we’re limtied, shortcode functions must return, not … continue reading »
Yesterday I wrote about Cache'ing CURL requests, today I had to write a small script that uses it for a web app I'm working on. It uses serialized PHP data instead of JSON but everything's pretty much the same. The app I'm creating needed a dynamic background image, something professional, new, and interesting. I wanted … continue reading »
When using PHP CURL with a third party API, I’ve found keeping the JSON results in a local cache is easier than constantly querying the service – especially when the API is slow or has query restrictions. Here’s a great snippet I save in my tool belt and use quite often: If the API is really slow (I’ve encountered … continue reading »
I‘ve been working on a Slack App that shows recent Slack posts and activities. The majority of recent posts include emojis, and problematically Slack’s API doesn‘t store and send emojis as characters, they’re down-converted to their respective shortnames, then wrapped in colons (presumably for universal support – it appears to be a standard practice of … continue reading »
Here‘s a neat little widget that’ll fetch your currently-reading and read books from your Goodreads shelf, and show them as a widget for either Panic Status Board (DIY Panel), or your website. Code is inspired and built upon from a great little 2013 script from flapane.com First, some styling: Setup, query and cache: Read and … continue reading »
One of my servers handled object buffering fine, the other wouldn’t partake. After hours of searching, and changing php settings, deep in a thread I found a solution for stubborn servers. If the following simple script doesn’t work out the gate: Try this instead, from a gentleman named Roger in Stackoverflow : A nasty work … continue reading »
Always a pain, finding the actual POST TYPE object of a Navigation Menu. This is the most straight forward solution I found to get the relation array. Which will return