Easily fetch deeply nested data from a heterogenous multi-dimensional collection in PHP using dot notation… or whatever that means.
Two utility functions you will definitely want to add to your arsenal are array_keys_whitelist() and array_keys_blacklist().
Occasionally, you may need to arbitrarily reindex an array of data in PHP. WordPress doesn’t really provide a function for doing this, so I put together this code snippet.
The visual aspects of a site are important and many themes depend on the ‘Featured Image’ functionality in WordPress to provide a better visual experience. So, it only makes sense that you may want to consider requiring a featured image before a post can be published.
Taking a WordPress image URL and using it to get the attachment ID is a bit tricky. There are a lot of code samples out there that do this, but they all have problems to some degree or another. Pippin Williamson posted a very elegant solution based on comparing the URL to the guid in… Read More
Featured images are most commonly used to display an image alongside the excerpt for a post on a blog page. If your theme doesn’t link the featured images to the post, can use this code to programmatically add the links.
WordPress, by default, will add the width and height attributes to image elements. These attributes will override CSS width and height properties. Making images with these dimension attributes responsive is a bit of a hassle, or in some cases cannot be done at all. Strip Image Dimension Attributes from Inserted Images Stripping out the image… Read More
Optimizing images for use on the web can significantly reduce page load times for image-heavy websites. What many people don’t realize is that WordPress automatically applies a 90% quality level to all JPEG images. This helps to conserve disk space and reduce bandwidth. However, if you are optimizing your images before you upload them, you… Read More