Category: WordPress Code
-
Never-Ending Pagination in WordPress
Take your site’s slideshows to the next level with the following: [code language=”php”]// Slightly different way of getting a previous…
-
WP-Config Options You Probably Didn’t Know About
1. Override options “siteurl” and “home” [code language=”php”]define(‘WP_SITEURL’, ‘http://your-sites-address.com’); define(‘WP_HOME’, ‘http://your-sites-address.com’);[/code] 2. Revisions [code language=”php”]define(‘WP_POST_REVISIONS’, FALSE); define(‘WP_POST_REVISION’, 3);[/code] 3. AutoSave…
-
Delete All Tags With 0 Posts
Delete all tags with zero posts tagged. Can also be used to delete all tags with one post. Or other…
-
SQL_CALC_FOUND_ROWS and no_found_rows
By default, the WordPress SQL query that selects posts from the database will use “SELECT SQL_CALC_FOUND_ROWS …”. This is mainly…
-
WordPress Hardening 101
With the recent public exploit of W3 Total Cache and the release of WordPress 3.5, it’s high time to tighten…
-
Merry Christmas, Now Patch Your WordPress Sites!
Thanks to the release of http://seclists.org/fulldisclosure/2012/Dec/242 on Christmas Eve, I’ve spent my holiday working security for several sites. This exploit…
-
Rewrite WP Attachment Images on the Fly
At first, this may not seem to have any real-world use, but consider this: You need to set up an…
-
Purge All WordPress Users of a Particular Role
I needed to delete all of the subscriber level users on one of my sites recently, and couldn’t find an…