For the past few days, I’ve been looking into one of those problems that makes you feel literally crazy. A customer complained that when searching their store for the phrase “Keep Trying” no products showed up. Since this is a Shopp site, I looked at the index to verify the index had those words […]
Enabling Genesis SEO Metabox on Shopp Products
We recently released the shiny new Moore and Giles website, which is built on Genesis 2.0. This afternoon, we realized how nice it would be to have those Genesis SEO Metaboxes in the Shopp Product editor. This turned out to be delightfully simple, requiring only a few lines in functions.php: View the code on Gist. […]
A MySQL Query Optimization Example
You’d think in 2013, query optimization would not be something we have to spend much time worrying about. But sadly, artificial intelligence has not come up with a solution to save us from this boring discipline. Take for example this query: View the code on Gist. Pretty simple right? The query pulls back the last […]
WordPress Simple Settings: A Settings API Alternative
If you’re the type of person who learns best by seeing code in action, you should look at my sample plugin on GitHub. Call me strange, but I’ve never been a huge fan of the WordPress Settings API. The sheer fact that a diagram like this might be necessary to explain it is indicative to […]
Taking Natural Sort (Alphanumeric) in WordPress Even Further
Yesterday I gave an example of how to filter the result from get_terms in WordPress to use a natural order, rather than alphanumeric. So, this: Car 1 Car 2 … Car 10 Not this: Car 1 Car 10 Car 2 … and so on Today, I’m going to show you how to add a new […]
Sorting WordPress Taxonomy Terms Naturally (Alphanumerically)
Inevitably, the standard alphabetical sort betrays you. Say you have a list like this: Car 1 Car 2 Car 3 Car 4 … etc Car 10 Using an ascending alphabetical sort, you’d end up with this sadness: Car 1 Car 10 Car 2 Car 3 Car 4 … and so on If your data is […]
Switching WordPress Databases and Git Branches Simultaneously
I’ve recently switched to a rather rad workflow involving a local copy of our website run through MAMP using a git repository. We’ve recently started working on a bigger set of changes that require a feature branch. But, these changes also will require WordPress to be upgraded to 3.3, requiring database changes. Making it impossible […]
Improve HTML E-mails from WordPress, automagically
HTML e-mails are like wild stallions. They are really hard to tame. I have been frustrated by the vastly different ways e-mails from my company’s site (http://www.mooreandgiles.com) render in different clients. After some research, I decided the trick to fix this would be inlining all CSS styles, as various clients will haphazardly abort style blocks you […]
Simple LDAP Login
Plugin Name: Simple LDAP Login Description: Integrating WordPress with LDAP shouldn’t be difficult. Now it isn’t. Simple LDAP Login provides all of the features, none of the hassles. URL: http://wordpress.org/plugins/simple-ldap-login/ Features Supports Active Directory and OpenLDAP (and other directory systems which comply to the LDAP standard, such as OpenDS) Supports TLS Uses up-to-date methods for WordPress […]
How To Execute PHP code in a PHP String (and return the output to another string)
Ever thought “Gee, it would be nice if I could store some PHP in a database and execute it at will?” Well you’re in luck my friend, PHP was thinking of you when they created the eval function. The syntax for eval is very simple: eval ( string $code_str ); Unfortunately, the output of eval does […]