Popular Posts
All posts ordered by popularity
Over 300 SQL Code Snippets for WordPress
I’m excited to launch my latest book, Wizard’s SQL Recipes for WordPress. Years in the making, Wizard’s SQL Recipes brings together over 300 recipes for managing and optimizing the WordPress database. If you’re a WordPress administrator or developer who wants to level up their database skills, this book’s for you. Check out the PDF Demo […]
Obscure template tags that rock
Here are my favorite “lesser-known” and perhaps even obscure template tags for WordPress:
Display the visitor’s Google search terms
A neat trick in your themes is to display the search terms used by the visitor somewhere on the page. Here’s how to do it for visitor’s arriving at your site after searching in Google.
Private URLs with .htaccess
With WordPress and other publishing software, you can create “private” and “password-protected” posts, but the URL is still going to be discoverable via search engines and visitors. This technique using .htaccess makes the post and URL accessible only to the specified IP addresses.
Display All PHP Errors on Screen
When working on a PHP project, I usually log any errors to a file (error log), but on some projects it’s necessary to display any errors right there on the page. Here is the code that I use to make it happen.
Note about date and time
Just a quick note about how WordPress handles dates and times.
Add Custom Info to PHP System Log
Here is a quick function for adding custom information to the system log via PHP.
WordPress Functions for Theme Testing
Some quick copy/paste snippets taken from my dev/test theme, Introspection. Posting them here for reference so I can grab ’em as needed.
Display external feeds in WordPress
WordPress makes it so easy to display external RSS feeds anywhere in your theme.
Quick KB/MB unit conversions
Working with .htaccess for stuff like file uploads, it’s frequently necessary to convert between kilobytes and megabytes.
Redirect Attacker to Special Message
If you are using Apache server, you can stop an attack by getting the IP address of the attacker and then using it to block or redirect all of their requests. Normally I just block the requests using either Deny or Require directives (depending on Apache version), but sometimes it’s fun to redirect the attacker […]
Triple Loop Navigation
Never thought this was possible, and still don’t know for sure because I haven’t had time to test this code sample found in a pastebin. Included here in its entirety for reference.